Crypto Venture Capital: Top 100 VCs Funds You need to Know

In this article, you'll learn What is Crypto Venture Capital, How to Investment and Top 100 Crypto Venture Capital You need to Know

What are Venture Capital Funds?

Venture capital (VC) firms are investment management companies dedicated to funding promising business opportunities for a specified amount of equity. With expertise in discovering talented entrepreneurs and developing business infrastructure, VCs raise exorbitant money, most often through private investors.

Venture capital firms play an essential role as engines for connecting ideas and business models with the funding necessary to develop new products and services and reach new audiences or communities.

Types Of VC Funding

Though there is some variation in terminology, most entrepreneurs and VCs recognize the following breakdown in funding types and purposes.

  • Pre-Seed: Initial funding from non-institutional investors.
  • Seed: First funding stage where a VC receives an equity stake.
  • Series A: Extended development funding to bolster the company’s business model.
  • Series B: Additional financing to scale business infrastructure and market reach.
  • Series C: Proven track record justifies additional funding for continued growth.
  • Series D and E: Less frequent and strategic in addressing business growth trajectory.

Venture Capital Vs Private Equity

Whereas most citizens, workers, and retirees hold some portion of the public stock market, private equity refers to equity investments made by private individuals and private equity firms. Private equity manages the entire lifecycle of private assets, from venture capital and growth equity to managed and leveraged buyouts.

Venture capital is a form of private equity focusing on early investing opportunities; meanwhile, notable private equity firms like Blackstone, KKR, and Thoma Bravo are known for post-IPO acquisitions.

How Do VC Firms Work?

VC firms are often limited partnerships (LP) led by General Partners (GPs) and made up of a staff managing the VC fund. Through an existing or new network of investors known as Limited Partners (LP), VC funds can raise capital for investing in a general or domain-specific portfolio of companies.

  • Opening The Door To Outside Influence

Though funding sounds nice, many startup nightmares come to mind. When accepting VC funding, entrepreneurs are giving up some level of control over the present or future of their company. Equity is the most evident cost to bear. Still, the fine print of VC agreements could also mean additional control over a prospective Board of Directors, management, business model, and more.

VCs are ultimately accountable to the wishes of their GPs and LPs and not afraid to make decisions to their benefit. 

There’s a broad spectrum of just how active partners are in guiding or managing their investments. As VCs want their investments to succeed, hands-on partners may ask a lot of their invested companies. Founders and startup leaders can often feel the temperature and pressure rise.

How to Land a Round of Funding

Landing a funding round is no easy task and can take months, if not years, to achieve.

Business Model:

Business models have long been the cornerstone for profiling a company commercially. By enumerating foundational business components like core operations, products and services, financing, and revenue sources, startup leaders can communicate their strategic plan for launching and growing a business in a single document or presentation.

Business Data:

Data is king, and VCs only have an entrepreneur’s word to trust without it. With data offering insight into sales, KPIs, and growth rates, startup leaders can justify their funding with reliable data points. With a high failure rate, startups with existing business metrics to cite are in a superior position to earn funding.

Networking:

Though an exceptional business model and data can’t hurt, they mean little without access to potential funding. Local funding opportunities and accelerator programs are convenient methods of initial financing for startups. At the same time, reaching firms like the above will mean existing connections or perseverance on top of an ironclad business plan.

With an extensive VC presence split between Silicon Valley and New York, it’s no surprise entrepreneurs lean toward starting their businesses in these locations. With proximity to multiple funding partners, opportunities to reach and earn funding are more accessible.

Timing:

Timing is critical to market success in the competitive landscape, especially within the ever-evolving IT ecosystem. Go-to-market strategies are an essential indicator of investment potential, and the timing of a business’s funding proposal or launch can and does make the difference. VCs seek the most innovative and new opportunities with the rare allowance for a unique spin on traditional solutions.

Top exchanges for token-coin trading. Follow instructions and make unlimited money

BinancePoloniexBitfinexHuobiMXCProBITGate.io


The Top 100 Crypto Venture Capital Funds

Now, let’s check out some of the notable VC funds in the cryptocurrency industry that are investing in the future: 

 NameDescriptionLink
1Coinbase VenturesCoinbase Ventures is an American VC firm that was founded in 2018 and is currently based in San Francisco, California, USA. As the investment arm of the digital asset exchange Coinbase, it should come as no surprise that the company is very active as a crypto startup VC. 

Coinbase Ventures has made a total of 130 investments into new blockchain and cryptocurrency startups.
Website
2Binance Labs
Binance Labs belongs to Binance, yet another famous centralized exchange. 

Binance Labs leverages the Binance DEX to invest in new crypto projects, and its portfolio includes stakes in Terra, Moonbeam and Coin98, among others.
Website
3Huobi CapitalHuobi Capital is the investment arm of Huobi Group, focusing exclusively on ventures and projects related to blockchain technology, digital currency, and crypto assets. Blockchain is not only an innovative technology but also a disruptive tool for social transformation.Website
4Jump CryptoJump Crypto is the investment arm of Jump Trading, another crypto trading fund with offices in Europe, Asia and North America. Jump Crypto has stakes in Solana, Terra, Wormhole, Fantom and many other projects.Website
5a16ZAndreessen Horowitz (a16z) is a US-based venture capital founded in 2009 by two co-founders, Marc Andreessen and Ben Horowitz, who took the fund after their name. In the early days, a16z determinedly invested in early-stage startups with bold technology ideas.

Apart from investing in crypto in the last few years, a16z’s investments include gaming, social media, education, IT, etc. In August 2021, a16z was reported to manage $18.8B in assets (not just crypto assets).
 
Website
6Alameda ResearchAlameda Research is a crypto hedge fund founded by FTX founder Sam Bankman-Fried and now headed by Sam Trabucco. It also has stakes in most important blockchains and blockchain-based companies. Website
7Genblock CapitalGenblock Capital has been involved in the blockchain space since early 2017 and is a VC fund with a focus on decentralized finance and the metaverse. Some of its main gaming-oriented investments include Aurory, Efinity and Bloktopia.
 
Website
8Animoca BrandsAnimoca Brands is one of the leaders in the metaverse VC firm space and was ranked in the Financial Times list of high growth companies in the Asia-Pacific region in 2021. 

It has investments in several significant metaverse and NFT-related projects like The Sandbox, Axie Infinity, OpenSea, Dapper Labs and several others.
Website
93AC - Three Arrows CapitalFounded in 2012 by Su Zhu and Kyle Davies, Three Arrows Capital is considered one of the top hedge funds and market makers in the space. 3AC holds stakes in several big blockchains like Ethereum, Avalanche, Bitcoin, Polkadot, Terra, Solana and many others.

It also has investments across several DeFi and GameFi projects like Axie Infinity, Aave and countless others. 3AC invests in equity-based blockchain projects, too. For instance, the fund has stakes in BlockFi, Deribit and Starkware.
Website
10Galaxy Capital FundGalaxy Digital is a diversified financial services and investment management innovator in the digital asset, cryptocurrency, and blockchain technology sectorWebsite
11MetapurseMetapurse is an NFT investment fund and production studio that specializes in identifying early-stage projects across blockchain infrastructure, finance, art, unique collectibles, and virtual estate. It has investments in Decentraland and Nifty Gateway.
 
Website
12ConsenSys VenturesStarting at number ten, we have ConsenSys Ventures based in San Francisco, California. Founded in 2016, ConsenSys Ventures is the investment arm of the blockchain software technology company, ConsenSys, the same company that developed the popular Ethereum-based MetaMask wallet.

ConsenSys make 32 investments in blockchain startups. 
Website
13MulticoinMulticoin is a "thesis-driven investment firm that invests in cryptocurrencies, tokens, and blockchain companies." It is a crypto-native fund that participates in staking, liquidations, and other crypto operations. Its portfolio includes stakes in Audius, Arweave and Near Protocol.Website
14Solidity VenturesSolidity Ventures is an investment firm that invests in an open and decentralized technology platform.Website
15Coingecko VenturesCoinGecko Ventures is the venture arm of CoinGecko where we invest in groundbreaking blockchain companies with big ambitions in architecting the future of finance.Website
16Polychain CapitalPolychain invests in protocols and companies in the blockchain space, advancing the global adoption of cryptocurrencies.
 
Website
17Winklevoss CapitalPerhaps one of the oldest in the game, Winklevoss Capital is an American VC firm birthed by the Winklevoss brothers in 2012. While the firm mainly operates from its New York office in the US, it provides seed funding and infrastructure to early-stage startups.

Winklevoss has made a total of 123 investments in new enterprises. In the company’s trading history, it has withdrawn from 23 of these positions. '
Website
18Dragonfly CapitalA cross-border cryptoasset investment firm. Dragonfly Capital Partners is investing in and supporting the promising opportunities in the cryptoasset class.Website
19122 West122WEST is a venture capital firm focused on early-stage internet and software investments in the San Francisco Bay Area.
 
Website
20Pantera CapitalPantera Capital was originally founded in 2003 as an asset management company based in Menlo Park, California. However, it subsequently launched what it claimed to be the first investment fund focused on Bitcoin in 2013. 

Pantera Capital has managed at least five investment funds, investment 145  startups, 15 of which it has pulled out from.
Website
21Pluto Digital VenturesPluto Digital PLC (Pluto) is a crypto technology and operations company that makes Web 3.0 Decentralised Finance (DeFi) more accessible to all.

Pluto is making DeFi available to everyone through products and services created by Pluto’s software development Labs division, new yield farming strategies through Pluto’s Yield division and collaboratingwith emerging DeFi projects and the NFT metaverse through Pluto’s Ventures division.
Website
22RRE VenturesFounded by Jim Robinson and Stuart Ellman in 1994, long before the launch of Bitcoin (the first mainstream cryptocurrency), RRE Ventures is an American VC firm headquartered in New York. 

Prior to its foray into crypto asset classes and startup funding, the American VC firm was known for investing in a wide array of companies operating across various emerging sectors including software, internet, communications, aerospace, robotics, 3D printing, and financial services among others.

Also, bBeing a top dog in the VC business, RRE invests at the early seed stage, Series A, and Series B rounds. More recently, the firm has made a significant investment in the crypto space that classifies it as a crypto startup venture capital.

Since inception, RRE Ventures has managed a total of nine investment funds and has backed a total of 567 projects across different phases. Currently, the almost three-decades old VC firm has successfully exited a total of 111 projects.
Website
23Boost VCBoost VC is an American Venture Capital Firm with experience in crypto startup VC. The company was founded in 2012 and is currently headquartered in San Mateo, California, USA. The company invests in new startups twice per year and provides other assistance such as mentoring and office space to help these businesses grow.

Since the VC firm was founded 10 years ago, it has managed a number of investment funds, which has allowed it to make 253 investments in that time. Of these investments, the company has currently exited from 25 of these investments.
Website
24Republic Labs CapitalRepublic Capital was established in January 2019. Is a growth-stage investment advisory focused on profitability and resiliency. Republic Labs works with high net-worth individuals and family offices to syndicate investment opportunities.Website
251 ConfirmationFounded by Nick Tomaino and backed by individuals like Peter Thiel, Marc Andreessen, and Mark Cuban and institutions like Horsley Bridge and Runa Capital, 1confirmation is a venture fund that supports exceptional founders fueling the decentralization of the web and society.Website
26MetaStable CapitalMetaStable Capital is an American investment firm that was founded in 2014 and is currently based in San Francisco, California, USA. The company manages crypto asset funds and seeks to further develop the value and the reputation of blockchain as a concept across the world.

Since the business was founded seven years ago, it has managed a single investment fund and it has used the money from this fund to make 21 investments into blockchain and cryptocurrency startups. At this time, the company has not made an exit from any of its investments.
 
Website
27Longhash VenturesLongHash Ventures is a global blockchain accelerator and venture capital fund. We seek financial returns through venture building and investing in early stage blockchain start ups, with a mission to enable the Web 3.0 blockchain native economy.Website
28KR1KR1 is a VC firm that was founded in 2016 and is currently based in Douglas in the Isle of Man. The company has a notable presence in Europe when it comes to providing investment into digital assets and blockchain networks. The company has been known for its tendencies to invest into crypto startups.

Since the business was established in 2016, it has made a total of 29 investments into new startups. At the present time, the company has not made an exit from any of these investments.
Website
29Craft VenturesCraft Ventures is an American VC firm that was founded four years ago and is currently based in San Francisco, California, USA. The company provides early-stage VC funding to a variety of different technology startups, including providing crypto startup VC. These funds have allowed the company to make 158 investments into growing startups. Website
30Amentum CapitalThe Amentum fund is a hybrid hedge/vc enterprise of blockchain-based, digital assets, and associated companies in the ecosystem. in addition to standard investments, the amentum team is available for project advisory opportunites for certain teams, following an excellent track record of successful advisory via general partners.Website
31Arrington CapitalArrington XRP Capital is a multi-strategy hedge fund specializing in early-stage venture and the public markets. Arrington Algorand Growth Fund is an ecosystem fund investing and incubating projects in the Algorand ecosystem. Arrington Moonbeam Growth Fund is an ecosystem fund investing and incubating projects in the Moonbeam ecosystem.Website
32Digital Currency GroupDigital Currency Group is an American VC firm that was founded in 2011 and is currently based in New York, USA. There is no doubt about the company's status as a crypto startup VC as it invests and provides support to companies in the cryptocurrency and blockchain spaces. Companies can benefit from its extensive network and access to industry-specific support. Total of 235 investments and has also acquired a further two businesses. Website
33AstratumAstratum is an interdisciplinary one-stop-shop, specialized in blockchain-based business models and registered as GmbH (equivalent to an LLC) in Baar, Switzerland (Cryptovalley).

Since 2014 its own research in blockchain and cryptoeconomics, which helped gathering deep insights into blockchain projects worldwide. 
Website
34Fenbushi CapitalFenbushi Capital is the first and most active blockchain-focused venture capital firm in Asia. Founded in Shanghai in 2015 by veterans across both blockchain and traditional financial industries, it has to date supported over 60 leading projects across 4 continents leveraging blockchain technology to reshape myriad industries such as finance, healthcare, supply chain, and consumer goods. Website
358 Decimal Capital8 Decimal Capital is an American VC firm that was founded four years ago and is currently based in San Francisco, California, USA. The company provides crypto startup VC across a variety of different funding stages and methods, including ICOs and their expert support ensures their startups have the best possible chance to succeed.

Since the company was founded four years ago, it has managed a sole investment fund. The use of this fund has allowed the company to make a total of 43 investments. 
Website
36Dekrypt CapitalDekrypt Capital is an American VC firm that was founded in 2017 and is currently based in Berkeley, California, USA. The company focuses its investment efforts on cryptocurrency startups and provides early-stage funding to help these companies to grow and reach their full potential.

This fund has given the company the ability to make a series of 12 investments into blockchain startups. 
Website
37Polychain CapitalPolychain is a VC focusing on blockchain-based digital assets. 

Its most notable investments are in Acala, Celo and dYdX.
Website
38AU21 CapitalFounded in 2017, AU21 Capital is a venture capital firm based in San Francisco, California. The firm seeks to invest in companies operating in the blockchain and artificial intelligence sectors.
 
Website
39Ascensive AssetsAscensive Assets is a seed-stage venture firm that invests in blockchain-enabled companies across the full spectrum of web3.Website
40A195 CaptialA195 is a vision driven firm providing capital globally to early stage blockchain, cryptocurrency, and tokenized digital assets.Website
41Alphabit FundAlphabit Fund is an actively managed cryptocurrency and digital asset investment fund. Its aim is to beat the performance of Bitcoin on a risk adjusted basis.
 
Website
42Blockchain CapitalBlockchain Capital is a leading venture firm in the blockchain industry.  Have made over 125 investments in companies and protocols in the sector, across different stages, geographies and asset types.Website
43Blockwall CapitalBlockwall Capital is a thesis-driven, sector focused, and independent blockchain investment firm that funds the development of Web 3.0 and decentralized technologies.Website
44X21 DigitalX21 Digital is a Blockchain Advisory and Investment firm dedicated to helping mainly blockchain startups accelerate their growth and exposure in the industry. Website
45BonFire VCBonfire Ventures leads Seed rounds for talented founders building the next generation of software giants.Website
46White Star CapitalWhite Star Capital is a global multi-stage investment platform built by a team of founders, investors and operators with a track record of entering Crypto markets.Website
47BlocktowerBlockTower is an institutional investment firm, applying professional trading, venture investing, credit underwriting, and portfolio management to digital and traditional assets.
 
Website
48Vandetta CapitalVendetta Capital has brought together a multi-disciplinary team that has immense experience spanning from investing, portfolio management, and capital markets to marketing and blockchain technology. 

Vendetta invests in, leads, and helps projects to accelerate developing novel solutions to address the core issues of scalability, privacy, and interoperability for decentralized protocols and applications.
Website
49Variant VCVariant is an early-stage fund investing in web3.Website
50Bitscale CapitalFounded in 2018, Bitscale Capital is a venture capital firm based in Switzerland. The firm seeks to invest in seed-stage, early-stage, and later-stage companies. The firm prefers to invest in big data, cryptocurrency, cybersecurity, the internet of things, fintech, and the technology sectors.
 
Website
51CoinfundFounded in 2015 and headquartered in New York City and Miami, CoinFund has evolved a combined venture, liquid, and cryptonative strategy to grow with an ever changing ecosystem. 

This multi-strategy approach means CoinFund invests in trends early and at key junctions as blockchain technology converges with the mainstream world.
Website
52Union Square VenturesUnion Square Ventures is a thesis-driven venture capital firm. Since 2003, have invested in over 100 companies that use the power of the internet to re-shape markets.Website
53Bixin VenturesBixin Ventures invests in early-stage infrastructure projects that cultivate and facilitate mass adoption of open finance through permissionless and decentralized networks.Website
54CoinixCoinIX manages a portfolio of cryptocurrencies and assets. The investment focus for venture investments is Europe and with a strong focus on companies using distributed ledger technologies.Website
55TRGCTRGC is a digital asset fund focused on investment Digital Assets, Web 3.0 and Blockchain Infrastructure. The ability to place value on an emerging ecosystem of blockchain protocols and application layers presents an exponential investment opportunity that doesn't come very often. Website
56Continue CapitalContinue Capital excels in investments on digital currency Startups , Private Equity and HFT Funds, focus on strategic sectors including Blockchain industry, innovative science and technologies. We continue to invest in breakthrough technologies. Website
57Collider VCCollider Ventures is an early-stage venture capital blockchain & cryptocurrency fundWebsite
58TVP FundVenture capital firm from Austin, Texas founded in 2016. Is an Austin-based venture capital firm focused on investing in highly technical seed- and early-stage startups in three core technology domains: Bitcoin-Native Technologies, Applied Artificial Intelligence, and Security and Privacy technologies.Website
59Coinstone CapitalCoinstone Capital is a boutique digital asset investment advisory firm.Website
60Signum CapitalSignum Capital is a Singapore-based firm that exclusively consults in Blockchain-enabled companies.Website
61Tally CapitalInvesting in the bridges, roads and tunnels of the blockchain ecosystem.Website
62Chainfund CapitalChainfund Capital is a Global FinTech Fund that invests in the next generation of financial technology. It has made 30 investments in researchers that are tackling problems across scalability, privacy, and formal verification. Chainfund supports its portfolio companies with an accelerator program to scale their technology to millions of users.

Based in San Francisco, California.
Website
63SequoiaSequoia Capital is an American venture capital firm. The firm is headquartered in Menlo Park, California and specializes in seed stage, early stage, and growth stage investments in private companies across technology sectors.Website
64Castle Island VCThey are a venture capital firm focused exclusively on public blockchains. They invest in infrastructure and application companies that will enable these transformative protocols to power services for the next billion users.Website
65Dalma CapitalDalma Capital is an award-winning global alternative investment platform, fund manager and accelerator for alpha generation with an inherent edge in emerging investment strategies and markets.Website
66LD CapitalLD Capital is one of Asia's earliest organizations focusing on value investing in blockchain field. Owing to industrial resource advantages and professional investment research teams, LD Capital has successively discovered and invested in projects such as Qtum, Vechain and Eos which all achieved over 100 times return.Website
67Sino Global CapitalSino Global Capital is an international crypto-native venture firm founded in 2015. Sino provide strategic investment to best-in-class companies that are moving the blockchain and digital assets ecosystems forward and then help them to thrive in the Asia market.Website
68DHVCDHVC is a venture capital firm based in Palo Alto, California. DHVC invest in AI, Bio, Crypto, and Consumer sectors. Website
69Slow VenturesSlow Ventures is an early-stage focused Venture Capital firm from Social Networking to Consumer Brands to SaaS, and Crypto. Based out of San Francisco and Boston.Website
70DTC CapitalDTC Capital is a Fundamentals Crypto Investment Fund.Website
71DeFi CapitalDeFi Capital is a Decentralized Finance investment fund.Website
72SW CapitalSW Capital Pvt. Ltd is a Financial Services Company, established in 1995.Website
73Signia VenturesSignia Venture Partners is an early stage fund dedicated to helping passionate entrepreneurs realize their vision and build impactful, high-growth ventures. 

Invest between $500k and $3m for an initial investment across a wide range of technology businesses, including within marketplaces, ecommerce, gaming, consumer mobile, virtual reality,enterprise technology, big data, and security.
Website
74Delphi DigitalA research-driven firm dedicated to advancing the understanding and development of the growing digital asset market.Website
75Divergence VCDivergence VC – The Crypto Operator Fund.Website
76Electric CapitalElectric Capital is a crypto asset management firm. The company invests in tokens that are Programmable Money and invest in both liquid and illiquid tokens that are emerging stores of value and rooted in novel technology. Electric Capital is started by technology entrepreneurs, engineers, and successful investors. 

They have been investing personally in cryptocurrencies since 2013 and were early believers in Bitcoin, Ethereum, and Monero. Prior to Electric
Website
77EdenblockEden Block is a private, independent, research-centric investment vehicle dedicated towards enriching the environments that make up the new iteration of the internet: web3.0. Focused on Blockchain, Artificial Intelligence and Cybersecurity

Eden Block continues to support the world’s most formidable teams, spearheading concrete development andfoundational business application.
Website
78eFounderseFounders is a startup studio. Since 2011, launched 28 companies, and have inspired new ways of working. 

Together with entrepreneurs, we turn unique ideas into successful companies. Our motto? We build the future of work!
Website
79Signature VenturesFounded in 2019, Signature Ventures is a venture capital fund based in Berlin and Munich, Germany. The firm focuses on equity investments in early-stage startups. The firm follows a research-driven approach and has access to an extensive ecosystem linking key Blockchain industry players, VCs, corporates and academics.
 
Website
80Scalar CapitalScalar Capital is a hedge fund company specializing in cryptoassets. Founded in 2017, the company is headquartered in San Francisco, California, United States.Website
81Fabric VenturesFabric is a venture contributor building and backing the boldest ideas in Web 3, to create a more fair, productive and sustainable economy—an Open Economy.Website
82Framework VenturesThey are a team of technologists, researchers and investors who buy assets of, who build for, and who participate in open crypto networks. 

At its core, Framework is a technology company, building products and services to support the open blockchain networks that they invest in. Framework was started in 2019.
Website
83Greenfield OneGreenfield One is an early-stage crypto and blockchain venture capital firm. Long-term bets on early developer teams building towards an open, decentralized and more robust architecture of tomorrow’s web.Website
84Robot VenturesRobot Ventures is a (pre-)seed investor in exceptional fintech and blockchain companies led by founders with big ambitionsWebsite
85GBICGBIC (Global Blockchain Innovative Capital) is a multi-strategy crypto fund. A global fund that furthers the development, acceleration and launch of blockchain projects.Website
86Hack VCHack VC is an early-stage venture capital firm that invests in the cryptocurrency, fintech, and marketplaces sectors. The company was founded in 2017 and is headquartered in San Francisco, California, United States.Website
87Hashkey CapitalHashkey they offers investment opportunities and solutions to institutions, family offices, funds, and professional accredited investors across the digital asset and blockchain ecosystem.Website
88Petrock CapitalPetrock Capital is a venture firm that invests in breakthrough blockchain technologies, ranging from ground-breaking Web 3.0 infrastructure to degenerately unorthodox concepts.Website
89Ideo CoLabIDEO CoLab Ventures is invest in early-stage distributed web startups and co-create with them to ship new products and protocols.Website
90Interchain VenturesInterchain Ventures works in the business and investment industry. They are made of entrepreneurs, investors, and influencers who invest in up-and-coming blockchain technologies. ​They are constantly looking for ambitious and visionary partners with the drive and flexibility to take their company to the next level. Investing in projects where the token has functional utilities within its network.Website
91Jump TradingJump Crypto is building toward the next frontier in crypto infrastructure.Website
92LemniscapLemniscap is an early stage investment firm specializing in investments in emerging crypto assets.Website
93Prota VenturesWe are Venture builders & investors. Forged from decades of business ideation, validation, and execution, our teams of experienced operators invest both time and capital into new ventures.Website
94M31 CapitalM31 Capital is a private equity investment firm that invests in public and private sector real estate markets.Website
95Monday CapitalMonday Capital – A fund built by engineers. For ambitious founders who love Mondays because they love what they do. Venture Capital with a focus on Blockchain, AI and VRWebsite
96Mosaic VenturesMosaic Ventures is a Silicon Valley-style venture capital firm based in London, focused on Series A. They are investing a $150 million fund in founding teams that are fundamentally reshaping big markets.Website
97Placeholder VCPlaceholder is a venture capital firm that invests in open blockchain networks and Web3 services.Website
98Mythos CapitalMythos Capital is an investment company that holds cryptoassets and services cryptonetworks.Website
99Metacartel VentureMetaCartel is a ecosystem of creators and operators building decentralized applications (DApps)Website
100Moonrock CapitalMoonrock Capital is a Blockchain Advisory and Investment Partnership based in London and Hamburg. Website
101Outlier VenturesAccelerating the Open Metaverse since 2014. We invest in creators building “The Open Metaverse,” a thesis and playbook outlining the future of freedom and equitable economics within digital environments.Website
102Master VenturesMaster Ventures is a blockchain-focused Venture Studio building the next generation of infrastructure companies to drive blockchain adoption.Website
103Nil FoundationNEO Global Capital is the strategic investment vehicle NEO foundation and one of the largest institutional owners of cryptocurrencies. It was founded 2017 and is based in Singapore.Website
104Oyster VCOyster Ventures is a venture capital firm investing in exceptional new-frontier technology companies. They target companies that bring liquidity and efficiency to antiquated industries, companies that enable globalization, with leverage to massively scale. It also specializes in early-stage investments in startups in fintech, with a focus onblockchain, crypto, E-commerce, market place, artificial intelligence, fintech, media tech, and SaaS companies.

Oyster Ventures was founded in 2016 and is headquartered in San Francisco, California, United States.
Website

Summary

Over the past few years, as crypto gained mainstream adoption, venture capital investing in the sector also continued to rise to new levels, with 7% of all global VC funding going into crypto in 2022.

Read more: How to Earn with Crypto Exchange Affiliate Programs

I hope this article will help you. Don't forget to leave a like, comment and sharing it with others. Thank you!

#blockchain #eth #ethereum #bitcoin #cryptocurrency #ada #cardano   

Crypto Venture Capital: Top 100 VCs Funds You need to Know
Castore  DeRose

Castore DeRose

1659575635

Comparing Ethereum vs. Cardano | Comparing ADA vs. ETH

In this article, you'll learn What is Ethereum, What is Cardano. Comparing Ethereum vs. Cardano. Which is better?

1. What is Ethereum (ETH)?

Ethereum is a blockchain-based computing platform that enables developers to build and deploy decentralized applications—meaning not run by a centralized authority. You can create a decentralized application for which the participants of that particular application are the decision-making authority.

Ethereum is a smart contract platform that can be used for the development of dApps. Ethereum was the first platform to launch smart contracts — programmatic agreements that can function like legal contracts and can be executed automatically once specific conditions have been met. The Ethereum white paper was published in 2013 and the project first launched in 2015. In 2016, ETH became the second token to ever be listed on Coinbase.

Ethereum Features

  • Ether: This is Ethereum’s cryptocurrency.
  • Smart contracts: Ethereum allows the development and deployment of these types of contracts.
  • Ethereum Virtual Machine: Ethereum provides the underlying technology—the architecture and the software—that understands smart contracts and allows you to interact with it.
  • Decentralized applications (Dapps): A decentralized application is called a Dapp (also spelled DAPP, App, or DApp) for short. Ethereum allows you to create consolidated applications, called decentralized applications.
  • Decentralized autonomous organizations (DAOs): Ethereum allows you to create these for democratic decision-making.

These are Ethereum’s essential features. 

How Does Ethereum Work?

Ethereum possesses the same characteristics of other blockchains, such as being an immutable public ledger of transactions, being censorship-resistant due to a decentralized consensus mechanism, and providing a secure network through proof-of-work hashing.

On Ethereum, users can send financial transactions by using the network’s native token, Ether (ETH). They can also participate in any number of dApps built on the network, including decentralized finance (DeFi) platforms, non-fungible token (NFT) marketplaces, and blockchain-based games.

Ethereum was the first network to allow for the use of smart contracts, resulting in the potential for developing dApps. Programmers can code specific conditions into smart contracts, giving them a variety of functionality. For example, a contract for a decentralized marketplace might be programmed to execute trades automatically when a buyer and seller both want to trade at a certain price.

Performing the functions of a smart contract requires a small fee known as Gas. Ethereum gas is measured in gwei, the smallest unit of ETH. Even though the fee for a single smart contract function can be very small, performing complex actions often involves numerous functions within multiple smart contracts, and the fees a user ends up paying can add up quickly.

Why is Ethereum popular?

Decentralised finance, or DeFi, is one of the most popular developments that came from Ethereum. DeFi is an umbrella term that covers decentralised apps and projects related to finance — lending in particular.

DeFi applications negate the need for financial intermediaries like banks or brokers. Users can borrow and lend money through smart contracts.

Smart contracts are programs that automatically execute when the terms of the contract are met. They automate verification processes through code. For example, releasing money into someone’s bank account on the same day every year — like their birthday.

Smart contracts replace human intermediaries in the same way that vending machines replace a human selling food and drinks.

Ethereum also gave rise to non-fungible tokens (NFTs). Every NFT has a unique signature and can’t be duplicated, making each token one of a kind. The most popular NFTs are digital artworks, but investors speculate they could one day be used for proofs of identity or property deeds.

Considerations that weigh in favor of Ethereum are:

  • Longevity – Ethereum is the third-largest cryptocurrency worldwide. It also offers smart contracts and other decentralized applications on its network. This makes it a very appealing asset for clever investors.
  • Ethereum 2.0 – The Ethereum 2.0 update will address some of the concerns with its PoW protocol. Long-term, this should increase Ethereum’s value.

2. What is Cardano (ADA)?

Cardano (also known as ADA) was launched in 2017 by a team led by Hoskinson. The project leaders seek to differentiate Cardano through a degree of academic rigor applied to its code. In addition, Cardano’s developers say it is built on peer-reviewed research that it hopes will give people confidence that its code is stable and solid.

To be the most environmentally sustainable blockchain platform is Cardano’s goal. It uses a unique PoS consensus mechanism called Ouroboros. With an improvement called Hydra, Ouroboros will enable near-instant finality. Implementing Ouroboros Hydra will boost scalability and will allow multiple side chains. In theory, it could increase throughput to 1 million TPS.

Cardano is the first to be founded on a peer-reviewed research PoS blockchain platform. Also, it was developed through evidence-based methods. The platform provides unparalleled security and sustainability to decentralized applications, systems, and societies. 

So users can do cross-network transactions through sidechains. Sidechains are different Blockchains connected to the main blockchain. Creating a link between blockchain networks allows digital tokens to be transferred between them.

There are two layers to the Cardano blockchain: the Cardano Settlement Layer (CSL) and the Cardano Computing Layer (CCL). The CSL contains the ledger of accounts and balances. The CCL layer is where all the computations for apps running on the blockchain are executed via the operations of smart contracts. Splitting the blockchain into two layers helps the Cardano network process as many as a million transactions a second.

The platform also introduced smart contract support in September 2021. The ecosystem is still in development, but many projects, including dApps and DeFi services, are in development.

The fact that Cardano cannot be mined makes it an 'environmentally friendly' cryptocurrency because it does not involve the energy-intensive aspects of mining. According to this model, all Cardano holders can vote on its direction. As well it makes Cardano transactions faster than Ethereum.

The Cardano platform was implemented into real-world projects such as tracking fresh agricultural produce, identifying counterfeit goods, and tamper-proofing educational credentials.

Main Differences:

  • The first blockchain network was developed via evidence-based methods and founded on the pillars of peer-reviewed research;
  • Uses a novel proof-of-stake consensus mechanism Ouroboros;
  • Smart contracts platform powered by the ADA coin;
  • Environmentally friendly cryptocurrency.

Cardano enables several different features on its platform:

  • Currency: With a cryptocurrency wallet, you can send and receive Cardano or transfer it in exchange for goods and services.
  • Smart contracts: Cardano enables smart contracts, which are contracts that automatically self-execute when the contract’s conditions are fulfilled.
  • Decentralized finance: Cardano enables people to skip the middleman, such as banks and other financial institutions, to transact directly and on a permission-less basis with other individuals or entities.
  • Digital apps: As part of decentralized finance, Cardano can enable lending, trading, asset management, insurance and other typical financial services.

How Does Cardano Work?

Like Ethereum, with Cardano developers can program smart contracts and create decentralized applications.

But whereas Ethereum tackles problems with its development as they arise, Cardano tries to plan for contingencies beforehand. It does this by performing scientific studies about proposed changes to the Cardano network.

On Cardano, users can also send financial transactions with the network’s native token, ADA.

Why is Cardano popular?

Cardano was designed to use PoS from its launch, and the mechanism is verifiably secure with rigorous security guarantees. Cardano was the first blockchain protocol based on peer-reviewed research.

Cardano’s PoS mechanism makes the network far more environmentally friendly than Ethereum and most other cryptocurrencies. This has already attracted many green investors.

The network is far more scalable than Ethereum and therefore could overtake it as the smart contract platform of choice.

The Cardano network can, in theory, run as many transactions as you could ever need without slowing down due to a bottleneck.

The network currently processes 266 transactions per second, but developers estimate it will one day process 1,000,000 transactions per second. Comparatively, Visa processes roughly 1,700 transactions per second.

Considerations that weigh in favor of Cardano are:

  • Ouroboros consensus protocol. The Cardano platform runs on the Ouroboros consensus protocol. Ouroboros, created by Cardano in its foundation phase, is the first PoS protocol that was proved to be secure. When choosing to invest in Cardano, the success of the Ouroboros protocol is a huge plus.
  • Scholarly academic research – Cardano’s development has been unique in that it has been informed by scholarly academic research. Each of Cardano’s development phases is supported by a research-based framework, incorporating peer-reviewed insights with evidence-based methods. This creates a strong foundation from which to make progress toward the future of both the blockchain network and the Ada token.

3. Comparing Ethereum vs. Cardano

Similarities Between Cardano and Ethereum

There are many similarities between Cardano and Ethereum. Both networks are trying to achieve the same thing — they just want to go about it differently. Some commonalities between the two cryptocurrencies include:

•   Both platforms provide smart contract functionality

•   Both can be used to develop dApps

•   Both can be used for sending financial transactions via the network’s native token

•   Once Ethereum upgrades to ETH 2.0, both will be proof-of-stake networks

Smart Contracts

With smart contracts, the rules are enforced by code, and the terms of the agreement can be executed automatically when the agreed-upon conditions have been met. This has opened up a new world of possibilities in terms of new applications that can be decentralized.

Smart contracts solve a number of problems that have plagued traditional contracts, specifically the potential for fraud, censorship, or third-party interference. These programmatic contracts are what made Ethereum unique and led it to becoming the second-largest cryptocurrency.

Over time, a number of competing networks that hope to improve upon Ethereum’s design have sprung up. Cardano is currently the largest Ethereum competitor by market cap.

Key Differences

Most of the differences between Cardano vs. Ethereum have to do with their approach to building a blockchain network and the philosophies of their creators.

Ethereum, for example:

•   Was created by Vitalik Buterin in 2015 in an attempt to do things Bitcoin couldn’t, specifically smart contracts

•   Takes more of a “build first, fix problems later” approach

Cardano, on the other hand:

•   Was created by Charles Hoskinson in 2017 as an improvement over Ethereum

•   Tries to use academic research to bolster its development beforehand

Another difference between the two networks is the number of dApps currently running on either platform. The vast majority of blockchain-based video games, NFT marketplaces, and DeFi protocols run on Ethereum or a layer-2 Ethereum network like Polygon.

There are at least 100 DeFi services running on Cardano, in addition to some other unique, disruptive projects.

Cardano’s naitve token is ADA vs. ETH for Ethereum. Both can be used to send financial transactions, although the fees and confirmation times may vary, with ADA usually having lower fees.

  • Proof of Work vs Proof of Stake

An important aspect of any blockchain network is its consensus mechanism. This refers to how all the nodes on a given network agree as to which transactions are valid and which are not (how they achieve consensus). Without consensus, there’s no blockchain, as an accurate distributed ledger couldn’t be maintained.

There are different potential ways of achieving consensus. Proof-of-work (PoW) and proof-of-stake (PoS) are currently the two most popular methods.

Ethereum currently utilizes PoW while Cardano makes use of PoS. Ethereum plans to transition to proof-of-stake consensus with the upgrade of ETH 2.0, which has been delayed many times.

PoW involves solving complex math problems to secure the network and validate transactions, which requires a lot of energy. This is the original consensus mechanism, first used on the Bitcoin network. While it has been criticized for being inefficient, it has also proven to be very secure, provided the network has a high enough hashrate.

PoS relies on the locking up or “staking” of network tokens to accomplish the same, which takes less computing power. Rather than relying on excessive amounts of computing power, this consensus mechanism relies on the total value of a network’s native token for security.

  • Monetary Policy

Another important difference between Cardano vs. Ethereum is each network’s monetary policy governing their respective tokens.

The distribution of both ADA tokens on the Cardano network and ETH on the Ethereum network are similar: the tokens get mined with every block and distributed in return for verifying transactions (in the case of ADA) and distributed to minders (in the case of ADA).

But when it comes to the supply limit placed on the issuance of new tokens, the two cryptos diverge significantly.

There is no limit placed on how many ETH can be minted. The supply of ETH tokens is programmed to increase at a rate of 4.5% annually. The supply of ADA tokens, on the other hand, is limited. According to Cardano’s code, there will only ever be 45 million ADA. As of early February 2022, there were 33.5 billion ADA in circulation.

  • Operational Philosophies

Ethereum takes more of a “build first, tackle problems later as they arise” approach. A good example of this would be the proposed upgrade to ETH 2.0 and transition to proof-of-stake. The need for this upgrade stems from Ethereum’s lack of ability to scale. Cardano proponents might argue that this should have been considered earlier and been dealt with in a scientific manner.

Cardano prefers to conduct rigorous scientific research before implementing changes to their protocol. The idea is to make sure all contingencies are planned for ahead of time so there will be fewer problems down the road.

  • Transaction Details

Cardano can currently process about 250 transactions per second (TPS) as opposed to 100 TPS for Ethereum. Cardano’s proposed Ouroborus Hydra upgrade could see the network’s possible TPS soar to as high as 2.5 million.

At the same time, Ethereum’s ETH 2.0 upgrade aims for an increase to 100,000 TPS. It could be said that Cardano is more ambitious, or that Ethereum is more realistic. A lot of these matters come down to the opinions of developers and users.

  • Energy Consumption

The proof-of-work consensus, which Ethereum uses, is a more energy intensive process than proof-of-stake, which powers the Cardano network. So, for now, Ethereum uses more energy than Cardano.

Ethereum uses about 14.81 terawatts to validate its transactions. In contrast, Cardano requires about 0.00052 terawatts.

If and when Ethereum does upgrade to ETH 2.0 and switch to the proof-of-stake consensus mechanism, then its energy usage will decline. But even then, it will use more energy than Cardano simply due to being a larger network that processes more transactions.

Summary of Differences Between Ethereum and Cardano:

FeatureEthereumCardano
Transactions per second13, but expected to reach 100,000 with Ethereum 2.0266, could rise into the millions once the initial development finishes in 2025
 Created to do things Bitcoin couldn’t, specifically smart contractsCreated as an improvement over Ethereum
Block times10-20 seconds20 seconds
Consensus MechanismProof-of-Work, set to transition to Proof-of-StakeProof-of-Stake
CoinNative token is ETHNative token is ADA
Smart ContractsEthereum supports smart contracts and is the market leader with 2,800 Dapps on its network using smart contractsIntroduced September 15 and compatibole with Ethereum's Solidity programming language
StakingYes, but quite complicated easy to set upEasy and accessible through many exchanges
Pros- First mover with smart contracts and NFTs- First mover with Proof-of-Stake
- Market leader in smart contracts, DeFi, NFTs- In theory infinitely scalable
- Huge developer community- Effortless staking
Cons- Currently high gas fees and slow transfer times during busy periods- Development roadmap won't be finished until 2025
- Currently losing developers because of performance issues- Lagging behind Ethereum in smart contract usage and DeFi applications
- Many applications 

How to buy Ethereum and Cardano

  1. Choose a cryptocurrency exchange. If you’re new to crypto, we offer an overview of some of the popular exchanges below.
  2. Choose a storage method — either a hot or cold wallet. Keeping your crypto on an exchange isn’t recommended long term.
  3. Place an order, then wait for your currency to land in your exchange wallet.
  4. Transfer your funds to your wallet away from the exchange. If you’re interested in staking, you’ll need a wallet that supports staking. The Daedalus wallet provides an easy staking experience for Cardano.

Top exchanges for trading: BinancePoloniexBitfinexHuobiMXCProBITGate.io

Conclusion

Cardano and Ethereum are both platforms with smart contract functionality that can be used to develop dApps. But the two have significant differences as well, from their market caps to the consensus they use (proof-of-stake vs. proof-of-work, respectively).

Read more: How to Earn with Crypto Exchange Affiliate Programs

I hope this article will help you. Don't forget to leave a like, comment and sharing it with others. Thank you!

#blockchain #eth #ethereum #bitcoin #cryptocurrency #ada #cardano   

Comparing Ethereum vs. Cardano | Comparing ADA vs. ETH

Interagindo Com O Cardano Blockchain Usando JavaScript

Cardano é uma rede blockchain de terceira geração pública, de prova de participação, descentralizada, fundada em 2015 pelo cofundador da Ethereum, Charles Hoskinson.

O blockchain Cardano foi construído para promover a interoperabilidade entre blockchains, escalabilidade e descentralização para promover a adoção em massa.

O desenvolvimento do Cardano é nativo em Plutus, Marlowe ou Glow; No entanto, a comunidade Cardano fornece um SDK para desenvolvimento em JavaScript e outras linguagens de programação.

Este tutorial irá guiá-lo através da introdução ao desenvolvimento Cardano em Javascript usando Cardanocli-js e Cardano-wallet-js.

O que são Cardanocli-JS e Cardano WalletJS?

Cardanocli-js é o SDK javascript mais popular para o desenvolvimento de blockchain Cardano. Ele suporta uma ampla gama de funcionalidades que você precisará desenvolver no blockchain Cardano, incluindo NFTs de cunhagem.

Cardano-wallet-js é um SDK javascript para desenvolvimento de blockchain Cardano com suporte a typescript. Ele pode ser usado para criar tokens nativos e NFTs juntamente com várias funcionalidades.

Nesta publicação, você aprenderá como integrar as funcionalidades do blockchain Cardano, como criar carteiras, pools de apostas e obter informações de rede em seus aplicativos Javascript.

Pré-requisitos

Para começar, você precisará tê-los instalados em seu computador/máquina.

  1. Baixe e instale o NodeJs do site oficial do NodeJs , é melhor que você baixe a versão LTS mais recente do NodeJS.
  2. Baixe e instale o executável CardanoCli em sua máquina, esta é uma dependência do CardanoCli-JS SDK, pois ajuda a conectar-se aos nós do blockchain Cardano que você precisa consultar e desenvolver no blockchain Cardano.
  3. Cardanocli-JS pode ser instalado usando este comando depois de instalar o NodeJs:npm install cardanocli-js
  4. Cardano-wallet-js pode ser instalado usando este comando npm:npm install cardano-wallet-js

Cardano-wallet-js requer que você tenha um servidor cardano-wallet em execução. você pode usar o docker para iniciar um servidor executando o comando abaixo ou siga estas instruções para colocar um servidor de carteira cardano-wallet em funcionamento.

wget <https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/docker-compose.yml>

NETWORK=testnet docker-compose up

Escolha um editor de texto ou IDE de sua preferência. Eu estarei usando o Jetbrains Webstorm neste tutorial.

Depois de ter todas essas configurações, crie um arquivo javascript em seu espaço de trabalho para este tutorial.

Estou usando o Ubuntu OS, se você estiver usando Windows ou macOS, pode haver pequenas diferenças na configuração.

Começando a usar Cardanocli-js

Conectando-se a um nó Cardano com Cardanocli-js

Obtenha um  número de compilação do nó para o site da IOHK . O número de compilação do nó é o número na URL quando você abre o link em seu navegador.

Crie um script bash em seu espaço de trabalho e insira esses comandos.

wget -N <https://hydra.iohk.io/build/${NBM}/download/1/mainnet-shelley-genesis.json>

Substitua ${NBM}pelo número de compilação do nó do site e execute o script bash usando este comando em seu terminal.

chmod +x fileName.sh

./fileName.sh

A primeira linha altera as permissões para tornar o arquivo executável enquanto a segunda linha executa o arquivo, criando um arquivo de configuração JSON em seu workspace com as configurações necessárias.

O arquivo de configuração ajuda na conexão a um nó Cardano na rede principal ou rede de teste conforme você especifica em seu programa.

Desenvolvimento Cardano usando Cardanocli-js

Primeiro, você importa o SDK cardanocli-js para uso em seu programa. Neste caso, é chamado clijs.

const clijs = require("cardanocli-js")

Em seguida, você deve criar uma instância da importação onde especificará a rede, o caminho do arquivo de configurações e um diretório de saída.

const cclijs = new cjs({
network: "mainnet",

directory: __dirname + "output Directory here",

shelleyGenesisPath: __dirname + "config file path here"
})

A rede pode ser uma rede principal ou uma rede de teste, dependendo do seu caso de uso.

Você pode testar a rede enquanto segue este tutorial e a rede principal em desenvolvimento.

Agora que você configurou uma instância de conexão blockchain, você pode realizar várias operações com Cardanocli-js

Criando uma carteira Cardano usando Cardanocli-js

Criar uma carteira Cardano é bastante fácil; você deve especificar um nome de carteira como parâmetros nos métodos de sua instância cardanocli-js, conforme mostrado abaixo.

const createAWallet = (walletName) => {
cclijs.addressKeyGen(walletName)

cclijs.stakeAddressKeyGen(walletName)

cclijs.stakeAddressBuild(walletName)

cclijs.addressBuild(walletName)

return cclijs.wallet(walletName)

}

A função acima cria uma carteira com o nome especificado quando a função é chamada.

console.log(createAWallet('your wallet name here"))

Depois que a função for executada na cadeia, um diretório chamado priv será criado na pasta de saídas especificada contendo as chaves privada e pública da carteira que você acabou de criar.

Exemplo de diretório privado

Consultando saldos da carteira usando Cardanocli-js

Você pode consultar os saldos da carteira especificando o nome da carteira no método wallet da sua instância cardanocli-js.

const getBalances = (walletName) => {
const query = cardano.wallet(walletName)

return query.balance()
}

A função acima retorna o saldo da carteira do nome da carteira especificada em um formato JSON assim.

{
utxo : [

    {

        txHash: "7436d178c092222396bd0b5cb71211bd87b098bb9e7e98d1a0f41390c1604711",

        txId: 0,

        amount: [Object]

    }

],

    amount:

{

    lovelace : 350000000

}

Na saída acima, supõe-se que a carteira tenha o ativo nativo Cardano $ ADA.

O saldo é exibido em Lovelaces, que pode ser convertido em ADA dividindo o valor por um milhão.

Criando um Stake Pool usando Cardanocli-js

Stake pools são os nomes personalizados para nós Cardano. Eles operam de forma semelhante aos nós Ethereum, exceto que Cardano é uma prova de blockchain de participação.

Os Stake Pools podem ser públicos ou privados e têm um endereço público para o qual os participantes da rede podem delegar seus tokens ADA para recompensas.

Criar um pool de participação usando Cardanocli-js é tão fácil quanto criar uma carteira.

const createAStakePool = (poolName) => {
cclijs.nodeKeyGenKES(poolName);

cclijs.nodeKeyGen(poolName);

cclijs.nodeIssueOpCert(poolName);

cclijs.nodeKeyGenVRF(poolName);

return cclijs.pool(poolName);
};

A função acima cria um stakepool associado ao nome que você especificou e gera arquivos em seu diretório especificado, assim como a createAWalletfunção fez. A função retorna o nome do pool quando é chamada.

console.log(createAWallet('your stakepool name here"))

Você criou com sucesso um pool de apostas Cardano e, assim como quando criou uma carteira acima, os arquivos foram criados em seu diretório de saída.

Introdução ao Cardano-wallet-js

Depois de instalar o Cardano-wallet-js, você pode importá-lo para uso.

const { seed, WalletServer: walletserver } = require('cardano-wallet-js');

let walletServer = WalletServer.init('Your wallet server host URL');

A instância do servidor de carteira é criada e inicializada usando o link para seu servidor de carteira. A semente será usada para a criação da carteira.

Criando uma carteira usando Cardano-wallet-js

Criar uma carteira Cardano usando Cardano-wallet-js é mais prático que Cardanocli-js. Você pode criar uma carteira usando a função abaixo.

let recoveryPhrase = seed.generateRecoveryPhrase()

let passPhrase = "name"

let walletName = "name"

let wallet = await walletServer.createOrRestoreShelleyWallet(walletName, mnemonic, passPhrase)

console.log(seed.toMnemonicList(recoveryPhrase))

No código acima, a semente é usada para gerar uma frase de recuperação, então, as variáveis passPhrase​​e walletNamesão criadas e passadas para a variável wallet que cria ou restaura uma carteira Cardano Shelley.

A última linha registra a lista de mnemônicos no console, os mnemônicos da carteira da era Shelly são 24 palavras.

Consultando informações do Cardano Blockchain

Você pode consultar o estado do blockchain Cardano usando o getNetworkInformationmétodo na instância do servidor de carteira que você criou.

let query = await walletServer.getNetworkInformation()

console.log(query)

Isso geraria um JSON contendo vários parâmetros, como status da rede, informações do nó, progresso da sincronização do blockchain e informações de época a partir das quais você pode selecionar os dados específicos necessários.

Saída Json

Consultando transações de endereço de carteira

Consultar as transações de um endereço de carteira pode ser útil em muitos casos. Você pode fazer isso usando o getTransactionsmétodo da instância wallet.

let transactions = await wallet.getTransactions();

console.log(transactions)

Você pode passar um intervalo de datas para o getTransactionsmétodo para selecionar transações em um intervalo de datas específico.

Como consultar detalhes específicos da transação

A funcionalidade para consultar detalhes específicos da transação pode ser feita passando o ID da transação.

let transaction = await wallet.getTransaction("transaction id");

O ID da transação é um conjunto de sequências aleatórias atribuídas após a conclusão de uma transação e pode ser copiada da carteira ou do provedor de blockchain.

Garantia de transação

Conclusão

Os SDKs Cardanocli-js e Cardano-wallet-js facilitam a interação com o blockchain Cardano usando Javascript em vez de escrever scripts Plutus, Marlowe Glow ou Bash para interagir com o blockchain.

No entanto, é impossível escrever contratos inteligentes nativos do Cardano em javascript no momento. Você pode integrar os SDKs Cardanocli-js e Cardano-wallet-js em seus projetos Web3.0 e Web2.0 como desejar.

Fonte: https://blog.logrocket.com/interacting-cardano-blockchain-using-javascript/

#blockchain #javascript #cardano 

Interagindo Com O Cardano Blockchain Usando JavaScript
Léon  Peltier

Léon Peltier

1655918880

Interagir Avec La Blockchain Cardano En Utilisant JavaScript

Cardano est un réseau de blockchain public, de preuve de participation, décentralisé et de troisième génération fondé en 2015 par le co-fondateur d'Ethereum, Charles Hoskinson.

La blockchain Cardano a été conçue pour favoriser l'interopérabilité entre les blockchains, l'évolutivité et la décentralisation afin de favoriser l'adoption massive.

Le développement de Cardano est nativement dans Plutus, Marlowe ou Glow ; Cependant, la communauté Cardano fournit un SDK pour le développement en JavaScript et d'autres langages de programmation.

Ce didacticiel vous guidera dans la prise en main du développement Cardano en Javascript à l'aide de Cardanocli-js et Cardano-wallet-js.

Que sont Cardanocli-JS et Cardano WalletJS ?

Cardanocli-js est le SDK javascript le plus populaire pour le développement de la blockchain Cardano. Il prend en charge un large éventail de fonctionnalités dont vous aurez besoin pour développer sur la blockchain Cardano, y compris la frappe de NFT.

Cardano-wallet-js est un SDK javascript pour le développement de blockchain Cardano avec prise en charge de typescript. Il peut être utilisé pour créer des jetons natifs et des NFT ainsi que plusieurs fonctionnalités.

Dans cette publication, vous apprendrez à intégrer les fonctionnalités de la blockchain de Cardano, telles que la création de portefeuilles, de pools de mises et l'obtention d'informations sur le réseau dans vos applications Javascript.

Conditions préalables

Pour commencer, vous devez les avoir installés sur votre ordinateur/machine.

  1. Téléchargez et installez NodeJs depuis le site officiel de NodeJs , il est préférable de télécharger la dernière version LTS de NodeJS.
  2. Téléchargez et installez l'exécutable CardanoCli sur votre machine. Il s'agit d'une dépendance du SDK CardanoCli-JS car il facilite la connexion aux nœuds de la blockchain Cardano que vous devez interroger et développer sur la blockchain Cardano.
  3. Cardanocli-JS peut être installé à l'aide de cette commande après avoir installé NodeJs :npm install cardanocli-js
  4. Cardano-wallet-js peut être installé à l'aide de cette commande npm :npm install cardano-wallet-js

Cardano-wallet-js nécessite que vous ayez un serveur cardano-wallet en cours d'exécution. vous pouvez utiliser docker pour démarrer un serveur en exécutant la commande ci-dessous ou suivre ces instructions pour obtenir un serveur wallet cardano-wallet opérationnel.

wget <https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/docker-compose.yml>

NETWORK=testnet docker-compose up

Choisissez un éditeur de texte ou un IDE de votre choix. J'utiliserai Jetbrains Webstorm dans ce tutoriel.

Une fois que vous avez toutes ces configurations, créez un fichier javascript dans votre espace de travail pour ce tutoriel.

J'utilise Ubuntu OS, si vous utilisez Windows ou macOS, il peut y avoir de légères différences dans la configuration.

Premiers pas avec Cardanocli-js

Connexion à un nœud Cardano avec Cardanocli-js

Obtenez un  numéro de build de nœud pour le site Web IOHK . Le numéro de build du nœud est le numéro dans l'URL lorsque vous ouvrez le lien dans votre navigateur.

Créez un script bash dans votre espace de travail et entrez ces commandes.

wget -N <https://hydra.iohk.io/build/${NBM}/download/1/mainnet-shelley-genesis.json>

Remplacez ${NBM}par le numéro de build du nœud du site Web et exécutez le script bash à l'aide de cette commande dans votre terminal.

chmod +x fileName.sh

./fileName.sh

La première ligne modifie les autorisations pour rendre le fichier exécutable tandis que la deuxième ligne exécute le fichier, créant un fichier de configuration JSON dans votre espace de travail avec les configurations nécessaires.

Le fichier de configuration aide à se connecter à un nœud Cardano sur le réseau principal ou le réseau test comme vous le spécifiez dans votre programme.

Développement Cardano à l'aide de Cardanocli-js

Tout d'abord, vous importez le SDK cardanocli-js pour l'utiliser dans votre programme. Dans ce cas, il s'appelle clijs.

const clijs = require("cardanocli-js")

Ensuite, vous devez créer une instance de l'importation dans laquelle vous spécifierez le réseau, le chemin du fichier de configuration et un répertoire de sortie.

const cclijs = new cjs({
network: "mainnet",

directory: __dirname + "output Directory here",

shelleyGenesisPath: __dirname + "config file path here"
})

Le réseau peut être un réseau principal ou un réseau de test selon votre cas d'utilisation.

Vous pouvez tester le réseau en suivant ce didacticiel et le réseau principal en développement.

Maintenant que vous avez configuré une instance de connexion blockchain, vous pouvez effectuer plusieurs opérations avec Cardanocli-js

Création d'un portefeuille Cardano à l'aide de Cardanocli-js

Créer un portefeuille Cardano est assez simple ; vous devez spécifier un nom de portefeuille en tant que paramètres dans les méthodes de votre instance cardanocli-js, comme indiqué ci-dessous.

const createAWallet = (walletName) => {
cclijs.addressKeyGen(walletName)

cclijs.stakeAddressKeyGen(walletName)

cclijs.stakeAddressBuild(walletName)

cclijs.addressBuild(walletName)

return cclijs.wallet(walletName)

}

La fonction ci-dessus crée un portefeuille avec le nom spécifié lors de l'appel de la fonction.

console.log(createAWallet('your wallet name here"))

Une fois la fonction exécutée sur la chaîne, un répertoire nommé priv sera créé dans votre dossier de sortie spécifié contenant les clés privées et publiques du portefeuille que vous venez de créer.

Exemple de répertoire privé

Interrogation des soldes de portefeuille à l'aide de Cardanocli-js

Vous pouvez interroger les soldes de portefeuille en spécifiant le nom du portefeuille dans la méthode wallet de votre instance cardanocli-js.

const getBalances = (walletName) => {
const query = cardano.wallet(walletName)

return query.balance()
}

La fonction ci-dessus renvoie le solde du portefeuille du nom de portefeuille spécifié dans un format JSON comme suit.

{
utxo : [

    {

        txHash: "7436d178c092222396bd0b5cb71211bd87b098bb9e7e98d1a0f41390c1604711",

        txId: 0,

        amount: [Object]

    }

],

    amount:

{

    lovelace : 350000000

}

Dans la sortie ci-dessus, on suppose que le portefeuille possède l'actif natif Cardano $ADA.

Le solde est affiché en Lovelaces, qui peut être converti en ADA en divisant la valeur par un million.

Créer un Stake Pool à l'aide de Cardanocli-js

Les pools de participations sont les noms personnalisés des nœuds Cardano. Ils fonctionnent de la même manière que les nœuds Ethereum, sauf que Cardano est une blockchain de preuve de participation.

Les pools de participations peuvent être publics ou privés et ils ont une adresse publique à laquelle les participants au réseau peuvent déléguer leurs jetons ADA pour des récompenses.

La création d'un pool de participations à l'aide de Cardanocli-js est aussi simple et similaire à la création d'un portefeuille.

const createAStakePool = (poolName) => {
cclijs.nodeKeyGenKES(poolName);

cclijs.nodeKeyGen(poolName);

cclijs.nodeIssueOpCert(poolName);

cclijs.nodeKeyGenVRF(poolName);

return cclijs.pool(poolName);
};

La fonction ci-dessus crée un pool d'enjeux associé au nom que vous avez spécifié et génère des fichiers dans votre répertoire spécifié, tout comme la createAWalletfonction l'a fait. La fonction renvoie le nom du pool lorsqu'elle est appelée.

console.log(createAWallet('your stakepool name here"))

Vous avez créé avec succès un pool de participations Cardano et, tout comme lorsque vous avez créé un portefeuille ci-dessus, les fichiers ont été créés dans votre répertoire de sortie.

Premiers pas avec Cardano-wallet-js

Une fois que vous avez installé Cardano-wallet-js, vous pouvez l'importer pour l'utiliser.

const { seed, WalletServer: walletserver } = require('cardano-wallet-js');

let walletServer = WalletServer.init('Your wallet server host URL');

L'instance du serveur de portefeuille est créée et initialisée à l'aide du lien vers votre serveur de portefeuille. La graine sera utilisée pour la création de portefeuille.

Créer un portefeuille à l'aide de Cardano-wallet-js

Créer un portefeuille Cardano à l'aide de Cardano-wallet-js est plus pratique que Cardanocli-js. Vous pouvez créer un portefeuille en utilisant la fonction ci-dessous.

let recoveryPhrase = seed.generateRecoveryPhrase()

let passPhrase = "name"

let walletName = "name"

let wallet = await walletServer.createOrRestoreShelleyWallet(walletName, mnemonic, passPhrase)

console.log(seed.toMnemonicList(recoveryPhrase))

Dans le code ci-dessus, la graine est utilisée pour générer une phrase de récupération, puis les variables passPhraseet walletNamesont créées et transmises à la variable wallet qui crée ou restaure un portefeuille Cardano Shelley.

La dernière ligne enregistre la liste des mnémoniques sur la console, les mnémoniques du portefeuille de l'ère Shelly sont de 24 mots.

Interroger les informations sur la chaîne de blocs Cardano

Vous pouvez interroger l'état de la blockchain Cardano en utilisant la getNetworkInformationméthode sur l'instance de serveur de portefeuille que vous avez créée.

let query = await walletServer.getNetworkInformation()

console.log(query)

Cela produirait un JSON contenant divers paramètres tels que l'état du réseau, les informations sur les nœuds, la progression de la synchronisation de la blockchain et les informations sur l'époque à partir desquelles vous pouvez sélectionner les données spécifiques dont vous avez besoin.

Sortie Json

Interroger les transactions d'adresse de portefeuille

Interroger les transactions d'une adresse de portefeuille peut s'avérer utile dans de nombreux cas. Vous pouvez le faire en utilisant la getTransactionsméthode de l'instance de portefeuille.

let transactions = await wallet.getTransactions();

console.log(transactions)

Vous pouvez transmettre une plage de dates dans la getTransactionsméthode pour sélectionner des transactions dans une plage de dates spécifique.

Interroger des détails de transaction spécifiques

La fonctionnalité d'interrogation des détails de transaction spécifiques peut être effectuée en transmettant l'ID de transaction de la transaction.

let transaction = await wallet.getTransaction("transaction id");

L'ID de transaction est un ensemble de chaînes aléatoires attribuées après la fin d'une transaction et peut être copié à partir du portefeuille ou du fournisseur de blockchain.

Garantie des transactions

Conclusion

Les SDK Cardanocli-js et Cardano-wallet-js facilitent l'interaction avec la blockchain Cardano en utilisant Javascript au lieu d'écrire des scripts Plutus, Marlowe Glow ou Bash pour interagir avec la blockchain.

Cependant, il est impossible d'écrire des contrats intelligents natifs Cardano en javascript à l'heure actuelle. Vous pouvez intégrer les SDK Cardanocli-js et Cardano-wallet-js dans vos projets Web3.0 et Web2.0 à votre guise.

Source : https://blog.logrocket.com/interacting-cardano-blockchain-using-javascript/

#blockchain #javascript #cardano 

Interagir Avec La Blockchain Cardano En Utilisant JavaScript
顾 静

顾 静

1655918400

使用 JavaScript 与 Cardano 区块链交互

Cardano 是一个公共的、股权证明的、去中心化的第三代区块链网络,由以太坊联合创始人 Charles Hoskinson 于 2015 年创立。

Cardano 区块链旨在促进跨区块链的互操作性、可扩展性和去中心化,以促进大规模采用。

卡尔达诺开发原生于Plutus、Marlowe 或 Glow;然而,Cardano 社区提供了一个用于 JavaScript 和其他编程语言开发的 SDK。

本教程将指导您开始使用 Cardanocli-js 和 Cardano-wallet-js 在 Javascript 中进行 Cardano 开发。

什么是 Cardanocli-JS 和 Cardano WalletJS?

Cardanocli-js 是用于 Cardano 区块链开发的最流行的 JavaScript SDK。它支持您需要在 Cardano 区块链上开发的各种功能,包括铸造 NFT。

Cardano-wallet-js 是一个用于 Cardano 区块链开发的 JavaScript SDK,支持打字稿。它可用于创建原生代币和 NFT 以及多种功能。

在本出版物中,您将学习如何集成 Cardano 区块链功能,例如在您的 Javascript 应用程序中创建钱包、权益池和获取网络信息。

先决条件

要开始使用,您需要在您的计算机/机器上安装这些。

  1. 从 NodeJs 官网下载并安装 NodeJs ,最好下载最新的 LTS 版本的 NodeJS。
  2. 在您的机器上下载并安装 CardanoCli 可执行文件,这是 CardanoCli-JS SDK 的依赖项,因为它有助于连接到您需要在 Cardano 区块链上查询和开发的 Cardano 区块链节点。
  3. 安装 NodeJs 后,可以使用此命令安装 Cardanocli-JS:npm install cardanocli-js
  4. 可以使用以下 npm 命令安装 Cardano-wallet-js:npm install cardano-wallet-js

Cardano-wallet-js 要求您运行 cardano-wallet 服务器。您可以使用 docker 通过运行以下命令来启动服务器,或者按照这些说明启动并运行钱包 cardano-wallet 服务器。

wget <https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/docker-compose.yml>

NETWORK=testnet docker-compose up

选择您选择的文本编辑器或 IDE。我将在本教程中使用Jetbrains Webstorm 。

完成所有这些设置后,在您的工作区中为本教程创建一个 javascript 文件。

我使用的是 Ubuntu 操作系统,如果您使用的是 Windows 或 macOS,设置可能会略有不同。

开始使用 Cardanocli-js

使用 Cardanocli-js 连接到 Cardano 节点

获取 IOHK 网站的节点内部版本号。节点内部版本号是您在浏览器中打开链接时 URL 中的编号。

在您的工作区中创建一个 bash 脚本并输入这些命令。

wget -N <https://hydra.iohk.io/build/${NBM}/download/1/mainnet-shelley-genesis.json>

替换${NBM}为网站上的节点内部版本号,并在终端中使用此命令运行 bash 脚本。

chmod +x fileName.sh

./fileName.sh

第一行更改权限以使文件可执行,而第二行执行文件,在您的工作区中创建一个带有必要配置的 JSON 配置文件。

配置文件有助于连接到您在程序中指定的主网或测试网上的 Cardano 节点。

使用 Cardanocli-js 进行 Cardano 开发

首先,您导入 cardanocli-js SDK 以在您的程序中使用。在这种情况下,它被命名为 clijs。

const clijs = require("cardanocli-js")

接下来,您必须创建一个导入实例,您将在其中指定网络、配置文件路径和输出目录。

const cclijs = new cjs({
network: "mainnet",

directory: __dirname + "output Directory here",

shelleyGenesisPath: __dirname + "config file path here"
})

根据您的用例,网络可以是主网或测试网。

您可以按照本教程和开发中的主网进行测试网。

现在您已经设置了区块链连接实例,您可以使用 Cardanocli-js 执行多项操作

使用 Cardanocli-js 创建 Cardano 钱包

创建 Cardano 钱包相当容易;您必须在 cardanocli-js 实例的方法中指定钱包名称作为参数,如下所示。

const createAWallet = (walletName) => {
cclijs.addressKeyGen(walletName)

cclijs.stakeAddressKeyGen(walletName)

cclijs.stakeAddressBuild(walletName)

cclijs.addressBuild(walletName)

return cclijs.wallet(walletName)

}

上面的函数使用调用函数时指定的名称创建一个钱包。

console.log(createAWallet('your wallet name here"))

在链上执行该函数后,将在您指定的输出文件夹中创建一个名为 priv 的目录,其中包含您刚刚创建的钱包的私钥和公钥。

隐私目录示例

使用 Cardanocli-js 查询钱包余额

您可以通过在 cardanocli-js 实例的 wallet 方法中指定钱包的名称来查询钱包余额。

const getBalances = (walletName) => {
const query = cardano.wallet(walletName)

return query.balance()
}

上述函数以 JSON 格式返回指定钱包名称的钱包余额。

{
utxo : [

    {

        txHash: "7436d178c092222396bd0b5cb71211bd87b098bb9e7e98d1a0f41390c1604711",

        txId: 0,

        amount: [Object]

    }

],

    amount:

{

    lovelace : 350000000

}

在上面的输出中,假设钱包有 Cardano 原生资产 $ADA。

余额显示在 Lovelaces 中,可以通过将值除以一百万转换为 ADA。

使用 Cardanocli-js 创建权益池

权益池是 Cardano 节点的自定义名称。它们的操作类似于以太坊节点,只是 Cardano 是权益证明区块链。

权益池可以是公共的或私有的,它们有一个公共地址,网络参与者可以将他们的 ADA 代币委托给该地址以获得奖励。

使用 Cardanocli-js 创建权益池与创建钱包一样简单。

const createAStakePool = (poolName) => {
cclijs.nodeKeyGenKES(poolName);

cclijs.nodeKeyGen(poolName);

cclijs.nodeIssueOpCert(poolName);

cclijs.nodeKeyGenVRF(poolName);

return cclijs.pool(poolName);
};

createAWallet上面的函数创建了一个与您指定的名称相关联的权益池,并像函数一样在您指定的目录中输出文件。该函数在调用时返回池名称。

console.log(createAWallet('your stakepool name here"))

您已成功创建 Cardano 权益池,就像您在上面创建钱包时一样,文件已在您的输出目录中创建。

Cardano-wallet-js 入门

安装 Cardano-wallet-js 后,您可以导入它以供使用。

const { seed, WalletServer: walletserver } = require('cardano-wallet-js');

let walletServer = WalletServer.init('Your wallet server host URL');

钱包服务器实例是使用指向您的钱包服务器的链接创建和初始化的。种子将用于创建钱包。

使用 Cardano-wallet-js 创建钱包

使用 Cardano-wallet-js 创建 Cardano 钱包比 Cardanocli-js 更实用。您可以使用以下功能创建钱包。

let recoveryPhrase = seed.generateRecoveryPhrase()

let passPhrase = "name"

let walletName = "name"

let wallet = await walletServer.createOrRestoreShelleyWallet(walletName, mnemonic, passPhrase)

console.log(seed.toMnemonicList(recoveryPhrase))

在上面的代码中,种子用于生成恢复短语,然后创建passPhrasewalletName变量并将其传递到创建或恢复 Cardano Shelley 钱包的钱包变量中。

最后一行将助记词列表记录到控制台,Shelly 时代的钱包助记词是 24 个单词。

查询卡尔达诺区块链信息

getNetworkInformation您可以使用您创建的钱包服务器实例上的方法查询 Cardano 区块链的状态。

let query = await walletServer.getNetworkInformation()

console.log(query)

这将输出一个 JSON,其中包含各种参数,例如网络状态、节点信息、区块链同步进度和纪元信息,您可以从中选择所需的特定数据。

查询钱包地址交易

在许多情况下,查询钱包地址的交易会派上用场。您可以使用getTransactions钱包实例的方法来做到这一点。

let transactions = await wallet.getTransactions();

console.log(transactions)

您可以将日期范围传递到getTransactions方法中以选择特定日期范围内的交易。

查询具体交易明细

查询特定交易详情的功能可以通过传递交易的交易 ID 来完成。

let transaction = await wallet.getTransaction("transaction id");

交易 ID 是交易完成后分配的一组随机字符串,可以从钱包或区块链提供商复制。

交易保证

结论

Cardanocli-js 和 Cardano-wallet-js SDK 使使用 Javascript 与 Cardano 区块链交互变得容易,而不是编写 Plutus、Marlowe Glow 或 Bash 脚本来与区块链交互。

但是,当时不可能用 javascript 编写 Cardano 原生智能合约。您可以随意将 Cardanocli-js 和 Cardano-wallet-js SDK 集成到您的 Web3.0 和 Web2.0 项目中。

来源:https ://blog.logrocket.com/interacting-cardano-blockchain-using-javascript/

#blockchain #javascript #cardano 

使用 JavaScript 与 Cardano 区块链交互
Trung  Nguyen

Trung Nguyen

1655917200

Tương Tác Với Cardano Blockchain Bằng JavaScript

Cardano là một mạng lưới blockchain thế hệ thứ ba công khai, phi tập trung, được thành lập vào năm 2015 bởi người đồng sáng lập Ethereum Charles Hoskinson.

Chuỗi khối Cardano được xây dựng để thúc đẩy khả năng tương tác trên các chuỗi khối, khả năng mở rộng và phân quyền để thúc đẩy việc áp dụng hàng loạt.

Sự phát triển của Cardano ban đầu là ở Plutus, Marlowe hoặc Glow; Tuy nhiên, cộng đồng Cardano cung cấp SDK để phát triển bằng JavaScript và các ngôn ngữ lập trình khác.

Hướng dẫn này sẽ hướng dẫn bạn bắt đầu phát triển Cardano trong Javascript bằng cách sử dụng Cardanocli-js và Cardano-wallet-js.

Cardanocli-JS và Cardano WalletJS là gì?

Cardanocli-js là SDK javascript phổ biến nhất để phát triển chuỗi khối Cardano. Nó hỗ trợ một loạt các chức năng mà bạn sẽ cần phát triển trên chuỗi khối Cardano bao gồm cả việc đúc NFT.

Cardano-wallet-js là một SDK javascript để phát triển chuỗi khối Cardano với hỗ trợ sắp chữ. Nó có thể được sử dụng để tạo mã thông báo và NFT gốc cùng với một số chức năng.

Trong ấn phẩm này, bạn sẽ học cách tích hợp các chức năng của chuỗi khối Cardano như tạo ví, nhóm cổ phần và nhận thông tin mạng trong các ứng dụng Javascript của bạn.

Điều kiện tiên quyết

Để bắt đầu, bạn cần phải cài đặt những thứ này trên máy tính / máy của mình.

  1. Tải xuống và cài đặt NodeJs từ trang web chính thức của NodeJs , tốt nhất là bạn nên tải phiên bản LTS mới nhất của NodeJS.
  2. Tải xuống và cài đặt tệp thực thi CardanoCli trên máy của bạn, Đây là phần phụ thuộc của CardanoCli-JS SDK vì nó giúp kết nối với các nút chuỗi khối Cardano mà bạn cần truy vấn và phát triển trên chuỗi khối Cardano.
  3. Cardanocli-JS có thể được cài đặt bằng lệnh này sau khi bạn đã cài đặt NodeJs:npm install cardanocli-js
  4. Cardano-wallet-js có thể được cài đặt bằng lệnh npm này:npm install cardano-wallet-js

Cardano-wallet-js yêu cầu bạn có một máy chủ cardano-wallet đang chạy. bạn có thể sử dụng docker để khởi động máy chủ bằng cách chạy lệnh bên dưới hoặc làm theo các hướng dẫn sau để thiết lập và chạy máy chủ wallet cardano-wallet.

wget <https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/docker-compose.yml>

NETWORK=testnet docker-compose up

Chọn một trình soạn thảo văn bản hoặc IDE mà bạn chọn. Tôi sẽ sử dụng Jetbrains Webstorm trong hướng dẫn này.

Khi bạn có tất cả các thiết lập này, hãy tạo một tệp javascript trong không gian làm việc của bạn cho hướng dẫn này.

Tôi đang sử dụng hệ điều hành Ubuntu, nếu bạn đang sử dụng Windows hoặc macOS, có thể có một chút khác biệt trong thiết lập.

Bắt đầu sử dụng Cardanocli-js

Kết nối với một nút Cardano bằng Cardanocli-js

Nhận  số bản dựng nút cho trang web IOHK . Số bản dựng của nút là số trong URL khi bạn mở liên kết trong trình duyệt của mình.

Tạo một tập lệnh bash trong không gian làm việc của bạn và nhập các lệnh này.

wget -N <https://hydra.iohk.io/build/${NBM}/download/1/mainnet-shelley-genesis.json>

Thay thế ${NBM}bằng số bản dựng nút từ trang web và chạy tập lệnh bash bằng lệnh này trong thiết bị đầu cuối của bạn.

chmod +x fileName.sh

./fileName.sh

Dòng đầu tiên thay đổi quyền để làm cho tệp thực thi trong khi dòng thứ hai thực thi tệp, tạo tệp cấu hình JSON trong không gian làm việc của bạn với các cấu hình cần thiết.

Tệp cấu hình giúp kết nối với nút Cardano trên mạng chính hoặc mạng thử nghiệm như bạn chỉ định trong chương trình của mình.

Phát triển Cardano bằng Cardanocli-js

Đầu tiên, bạn nhập SDK cardanocli-js để sử dụng trong chương trình của mình. Trong trường hợp này, nó được đặt tên là clijs.

const clijs = require("cardanocli-js")

Tiếp theo, bạn phải tạo một phiên bản nhập mà bạn sẽ chỉ định mạng, đường dẫn tệp cấu hình và thư mục đầu ra.

const cclijs = new cjs({
network: "mainnet",

directory: __dirname + "output Directory here",

shelleyGenesisPath: __dirname + "config file path here"
})

Mạng có thể là mạng chính hoặc mạng thử nghiệm tùy thuộc vào trường hợp sử dụng của bạn.

Bạn có thể testnet khi làm theo hướng dẫn này và mainnet đang được phát triển.

Bây giờ bạn đã thiết lập một phiên bản kết nối blockchain, bạn có thể thực hiện nhiều hoạt động với Cardanocli-js

Tạo Ví Cardano bằng Cardanocli-js

Tạo một ví Cardano khá dễ dàng; bạn phải chỉ định tên ví làm tham số trong các phương thức của phiên bản cardanocli-js của bạn như được hiển thị bên dưới.

const createAWallet = (walletName) => {
cclijs.addressKeyGen(walletName)

cclijs.stakeAddressKeyGen(walletName)

cclijs.stakeAddressBuild(walletName)

cclijs.addressBuild(walletName)

return cclijs.wallet(walletName)

}

Hàm trên tạo một ví với tên được chỉ định khi hàm được gọi.

console.log(createAWallet('your wallet name here"))

Khi chức năng được thực thi onchain, một thư mục có tên priv sẽ được tạo trong thư mục đầu ra được chỉ định của bạn chứa các khóa riêng tư và khóa công khai cho ví bạn vừa tạo.

Ví dụ về thư mục chính

Truy vấn số dư trên Wallet bằng Cardanocli-js

Bạn có thể truy vấn số dư ví bằng cách chỉ định tên của ví trong phương thức ví của phiên bản cardanocli-js của bạn.

const getBalances = (walletName) => {
const query = cardano.wallet(walletName)

return query.balance()
}

Hàm trên trả về số dư ví của tên ví được chỉ định ở định dạng JSON như vậy.

{
utxo : [

    {

        txHash: "7436d178c092222396bd0b5cb71211bd87b098bb9e7e98d1a0f41390c1604711",

        txId: 0,

        amount: [Object]

    }

],

    amount:

{

    lovelace : 350000000

}

Trong kết quả đầu ra ở trên, giả sử rằng ví có tài sản gốc của Cardano là $ ADA.

Số dư được hiển thị trong Lovelaces, có thể được chuyển đổi thành ADA bằng cách chia giá trị cho một triệu.

Tạo Stake Pool bằng Cardanocli-js

Nhóm cổ phần là tên tùy chỉnh cho các nút Cardano. Chúng hoạt động tương tự như các nút Ethereum ngoại trừ việc Cardano là một blockchain bằng chứng về cổ phần.

Các nhóm cổ phần có thể là công khai hoặc riêng tư và chúng có địa chỉ công khai để những người tham gia mạng có thể ủy thác mã thông báo ADA của họ cho phần thưởng.

Tạo một nhóm cổ phần bằng cách sử dụng Cardanocli-js rất dễ dàng và tương tự như tạo ví.

const createAStakePool = (poolName) => {
cclijs.nodeKeyGenKES(poolName);

cclijs.nodeKeyGen(poolName);

cclijs.nodeIssueOpCert(poolName);

cclijs.nodeKeyGenVRF(poolName);

return cclijs.pool(poolName);
};

Hàm ở trên tạo một nhóm cổ phần được liên kết với tên bạn đã chỉ định và xuất các tệp trong thư mục được chỉ định của bạn giống như createAWallethàm đã làm. Hàm trả về tên nhóm khi nó được gọi.

console.log(createAWallet('your stakepool name here"))

Bạn đã tạo thành công nhóm cổ phần Cardano và giống như khi bạn tạo ví ở trên, các tệp đã được tạo trong thư mục đầu ra của bạn.

Bắt đầu với Cardano-wallet-js

Khi bạn đã cài đặt Cardano-wallet-js, bạn có thể nhập nó để sử dụng.

const { seed, WalletServer: walletserver } = require('cardano-wallet-js');

let walletServer = WalletServer.init('Your wallet server host URL');

Phiên bản máy chủ ví được tạo và khởi chạy bằng liên kết đến máy chủ ví của bạn. Hạt giống sẽ được sử dụng để tạo ví.

Tạo Ví bằng Cardano-wallet-js

Tạo ví Cardano bằng Cardano-wallet-js thực tế hơn Cardanocli-js. Bạn có thể tạo ví bằng chức năng bên dưới.

let recoveryPhrase = seed.generateRecoveryPhrase()

let passPhrase = "name"

let walletName = "name"

let wallet = await walletServer.createOrRestoreShelleyWallet(walletName, mnemonic, passPhrase)

console.log(seed.toMnemonicList(recoveryPhrase))

Trong đoạn mã trên, hạt giống được sử dụng để tạo cụm từ khôi phục, sau đó, các biến passPhrasewalletNameđược tạo và chuyển vào biến ví để tạo hoặc khôi phục ví Cardano Shelley.

Dòng cuối cùng ghi danh sách các ghi nhớ vào bảng điều khiển, các ghi nhớ của ví thời đại Shelly là 24 từ.

Truy vấn thông tin chuỗi khối Cardano

Bạn có thể truy vấn trạng thái của chuỗi khối Cardano bằng getNetworkInformationphương pháp trên phiên bản máy chủ ví mà bạn đã tạo.

let query = await walletServer.getNetworkInformation()

console.log(query)

Điều này sẽ xuất ra một JSON chứa các tham số khác nhau như trạng thái mạng, thông tin nút, tiến trình đồng bộ hóa chuỗi khối và thông tin kỷ nguyên mà từ đó bạn có thể chọn dữ liệu cụ thể mà mình cần.

Đầu ra Json

Truy vấn các giao dịch địa chỉ Wallet

Truy vấn các giao dịch của một địa chỉ ví có thể hữu ích trong nhiều trường hợp. Bạn có thể làm điều đó bằng cách sử dụng getTransactionsphương thức của ví dụ.

let transactions = await wallet.getTransactions();

console.log(transactions)

Bạn có thể chuyển phạm vi ngày vào getTransactionsphương pháp để chọn các giao dịch trong một phạm vi ngày cụ thể.

Truy vấn chi tiết giao dịch cụ thể

Chức năng truy vấn chi tiết giao dịch cụ thể có thể được thực hiện bằng cách chuyển ID giao dịch của giao dịch.

let transaction = await wallet.getTransaction("transaction id");

ID giao dịch là một tập hợp các chuỗi ngẫu nhiên được chỉ định sau khi giao dịch hoàn thành và có thể được sao chép từ ví hoặc nhà cung cấp chuỗi khối.

Đảm bảo giao dịch

Sự kết luận

Các SDK Cardanocli-js và Cardano-wallet-js giúp dễ dàng tương tác với chuỗi khối Cardano bằng cách sử dụng Javascript thay vì viết Plutus, Marlowe Glow hoặc Bash Scripts để tương tác với chuỗi khối.

Tuy nhiên, không thể viết các hợp đồng thông minh gốc Cardano bằng javascript vào thời điểm đó. Bạn có thể tích hợp các SDK Cardanocli-js và Cardano-wallet-js vào Dự án Web3.0 và Web2.0 của mình tùy ý.

Nguồn: https://blog.logrocket.com/interactive-cardano-blockchain-using-javascript/

#blockchain #javascript #cardano 

Tương Tác Với Cardano Blockchain Bằng JavaScript

Interactuando con Cardano Blockchain usando JavaScript

Cardano es una red blockchain pública, de prueba de participación, descentralizada y de tercera generación fundada en 2015 por el cofundador de Ethereum, Charles Hoskinson.

La cadena de bloques de Cardano se creó para fomentar la interoperabilidad entre las cadenas de bloques, la escalabilidad y la descentralización para fomentar la adopción masiva.

El desarrollo de Cardano es nativo en Plutus, Marlowe o Glow; Sin embargo, la comunidad de Cardano proporciona un SDK para el desarrollo en JavaScript y otros lenguajes de programación.

Este tutorial lo guiará para comenzar con el desarrollo de Cardano en Javascript usando Cardanocli-js y Cardano-wallet-js.

¿Qué son Cardanocli-JS y Cardano WalletJS?

Cardanocli-js es el SDK de javascript más popular para el desarrollo de blockchain de Cardano. Admite una amplia gama de funcionalidades que necesitará desarrollar en la cadena de bloques de Cardano, incluida la acuñación de NFT.

Cardano-wallet-js es un SDK de javascript para el desarrollo de blockchain de Cardano con soporte de mecanografiado. Se puede usar para crear tokens nativos y NFT junto con varias funcionalidades.

En esta publicación, aprenderá a integrar las funcionalidades de la cadena de bloques de Cardano, como la creación de billeteras, los grupos de participación y la obtención de información de la red en sus aplicaciones Javascript.

requisitos previos

Para comenzar, deberá tenerlos instalados en su computadora/máquina.

  1. Descargue e instale NodeJs desde el sitio web oficial de NodeJs , lo mejor es que descargue la última versión LTS de NodeJS.
  2. Descargue e instale el ejecutable CardanoCli en su máquina. Esta es una dependencia para CardanoCli-JS SDK, ya que ayuda a conectarse a los nodos de la cadena de bloques de Cardano que necesita consultar y desarrollar en la cadena de bloques de Cardano.
  3. Cardanocli-JS se puede instalar usando este comando después de haber instalado NodeJs:npm install cardanocli-js
  4. Cardano-wallet-js se puede instalar usando este comando npm:npm install cardano-wallet-js

Cardano-wallet-js requiere que tenga un servidor cardano-wallet en ejecución. puede usar la ventana acoplable para iniciar un servidor ejecutando el siguiente comando o siga estas instrucciones para poner en funcionamiento un servidor de monedero cardano-monedero.

wget <https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/docker-compose.yml>

NETWORK=testnet docker-compose up

Elija un editor de texto o IDE de su elección. Usaré Jetbrains Webstorm en este tutorial.

Una vez que tenga todas estas configuraciones, cree un archivo javascript en su espacio de trabajo para este tutorial.

Estoy usando Ubuntu OS, si está usando Windows o macOS, puede haber ligeras diferencias en la configuración.

Primeros pasos con Cardanocli-js

Conexión a un nodo de Cardano con Cardanocli-js

Obtenga un  número de compilación de nodo para el sitio web de IOHK . El número de compilación del nodo es el número en la URL cuando abre el enlace en su navegador.

Cree un script bash en su espacio de trabajo e ingrese estos comandos.

wget -N <https://hydra.iohk.io/build/${NBM}/download/1/mainnet-shelley-genesis.json>

Reemplace ${NBM}con el número de compilación del nodo del sitio web y ejecute el script bash usando este comando en su terminal.

chmod +x fileName.sh

./fileName.sh

La primera línea cambia los permisos para hacer que el archivo sea ejecutable mientras que la segunda línea ejecuta el archivo, creando un archivo de configuración JSON en su espacio de trabajo con las configuraciones necesarias.

El archivo de configuración ayuda a conectarse a un nodo Cardano en la red principal o en la red de prueba, según lo especifique en su programa.

Desarrollo de Cardano usando Cardanocli-js

Primero, importa el SDK de cardanocli-js para usarlo en su programa. En este caso, se llama clijs.

const clijs = require("cardanocli-js")

A continuación, debe crear una instancia de la importación donde especificará la red, la ruta del archivo de configuración y un directorio de salida.

const cclijs = new cjs({
network: "mainnet",

directory: __dirname + "output Directory here",

shelleyGenesisPath: __dirname + "config file path here"
})

La red podría ser una red principal o una red de prueba según su caso de uso.

Puede probar la red mientras sigue este tutorial y la red principal en desarrollo.

Ahora que ha configurado una instancia de conexión de cadena de bloques, puede realizar múltiples operaciones con Cardanocli-js

Creación de una billetera Cardano usando Cardanocli-js

Crear una billetera Cardano es bastante fácil; debe especificar un nombre de billetera como parámetros en los métodos de su instancia cardanocli-js como se muestra a continuación.

const createAWallet = (walletName) => {
cclijs.addressKeyGen(walletName)

cclijs.stakeAddressKeyGen(walletName)

cclijs.stakeAddressBuild(walletName)

cclijs.addressBuild(walletName)

return cclijs.wallet(walletName)

}

La función anterior crea una billetera con el nombre especificado cuando se llama a la función.

console.log(createAWallet('your wallet name here"))

Una vez que la función se ejecuta en cadena, se creará un directorio llamado priv en su carpeta de salidas especificada que contiene las claves públicas y privadas para la billetera que acaba de crear.

Consulta de saldos de billetera usando Cardanocli-js

Puede consultar los saldos de la billetera especificando el nombre de la billetera en el método de billetera de su instancia de cardanocli-js.

const getBalances = (walletName) => {
const query = cardano.wallet(walletName)

return query.balance()
}

La función anterior devuelve el saldo de la billetera del nombre de la billetera especificado en un formato JSON como este.

{
utxo : [

    {

        txHash: "7436d178c092222396bd0b5cb71211bd87b098bb9e7e98d1a0f41390c1604711",

        txId: 0,

        amount: [Object]

    }

],

    amount:

{

    lovelace : 350000000

}

En el resultado anterior, se supone que la billetera tiene el activo nativo de Cardano $ADA.

El saldo se muestra en Lovelaces, que se puede convertir a ADA dividiendo el valor por un millón.

Creando un Stake Pool usando Cardanocli-js

Los grupos de participación son los nombres personalizados para los nodos de Cardano. Funcionan de manera similar a los nodos de Ethereum, excepto que Cardano es una cadena de bloques de prueba de participación.

Los grupos de participación pueden ser públicos o privados y tienen una dirección pública a la que los participantes de la red pueden delegar sus tokens ADA para obtener recompensas.

Crear un stake pool usando Cardanocli-js es tan fácil y similar como crear una billetera.

const createAStakePool = (poolName) => {
cclijs.nodeKeyGenKES(poolName);

cclijs.nodeKeyGen(poolName);

cclijs.nodeIssueOpCert(poolName);

cclijs.nodeKeyGenVRF(poolName);

return cclijs.pool(poolName);
};

La función anterior crea un stakepool asociado con el nombre que ha especificado y genera archivos en su directorio especificado tal como lo createAWallethizo la función. La función devuelve el nombre del grupo cuando se llama.

console.log(createAWallet('your stakepool name here"))

Ha creado con éxito un grupo de participación de Cardano y, al igual que cuando creó una billetera arriba, los archivos se crearon en su directorio de salida.

Primeros pasos con Cardano-wallet-js

Una vez que haya instalado Cardano-wallet-js, puede importarlo para usarlo.

const { seed, WalletServer: walletserver } = require('cardano-wallet-js');

let walletServer = WalletServer.init('Your wallet server host URL');

La instancia del servidor de billetera se crea e inicializa utilizando el enlace a su servidor de billetera. La semilla se utilizará para la creación de billeteras.

Crear una billetera usando Cardano-wallet-js

Crear una billetera Cardano usando Cardano-wallet-js es más práctico que Cardanocli-js. Puede crear una billetera usando la función a continuación.

let recoveryPhrase = seed.generateRecoveryPhrase()

let passPhrase = "name"

let walletName = "name"

let wallet = await walletServer.createOrRestoreShelleyWallet(walletName, mnemonic, passPhrase)

console.log(seed.toMnemonicList(recoveryPhrase))

En el código anterior, la semilla se usa para generar una frase de recuperación, luego, las variables passPhrasey walletNamese crean y pasan a la variable de billetera que crea o restaura una billetera Cardano Shelley.

La última línea registra la lista de mnemotécnicos en la consola, los mnemotécnicos de la billetera de la era Shelly son 24 palabras.

Consulta de información de la cadena de bloques de Cardano

Puede consultar el estado de la cadena de bloques de Cardano utilizando el getNetworkInformationmétodo en la instancia del servidor de billetera que creó.

let query = await walletServer.getNetworkInformation()

console.log(query)

Esto generaría un JSON que contiene varios parámetros, como el estado de la red, la información del nodo, el progreso de la sincronización de la cadena de bloques y la información de la época, desde la cual puede seleccionar los datos específicos que necesita.

Consulta de transacciones de direcciones de billetera

Consultar las transacciones de una dirección de billetera puede ser útil en muchos casos. Puede hacerlo usando el getTransactionsmétodo de la instancia de la billetera.

let transactions = await wallet.getTransactions();

console.log(transactions)

Puede pasar un rango de fechas al getTransactionsmétodo para seleccionar transacciones en un rango de fechas específico.

Consulta de detalles de transacciones específicas

La funcionalidad para consultar detalles de transacciones específicas se puede realizar pasando el ID de transacción de la transacción.

let transaction = await wallet.getTransaction("transaction id");

La identificación de la transacción es un conjunto de cadenas aleatorias asignadas después de que se completó una transacción y se puede copiar desde la billetera o el proveedor de blockchain.

Conclusión

Los SDK de Cardanocli-js y Cardano-wallet-js facilitan la interacción con la cadena de bloques de Cardano usando Javascript en lugar de escribir Plutus, Marlowe Glow o Bash Scripts para interactuar con la cadena de bloques.

Sin embargo, es imposible escribir contratos inteligentes nativos de Cardano en javascript en ese momento. Puede integrar los SDK Cardanocli-js y Cardano-wallet-js en sus proyectos Web3.0 y Web2.0 como desee.

Fuente: https://blog.logrocket.com/interacting-cardano-blockchain-using-javascript/

#blockchain #javascript #cardano 

Interactuando con Cardano Blockchain usando JavaScript
坂本  健一

坂本 健一

1655879629

JavaScriptを使用したCardanoブロックチェーンとの対話

Cardanoは、イーサリアムの共同創設者であるCharles Hoskinsonによって2015年に設立された、公開されたプルーフオブステークの分散型第3世代ブロックチェーンネットワークです。

Cardanoブロックチェーンは、ブロックチェーン間の相互運用性、スケーラビリティ、および分散化を促進して大量採用を促進するために構築されました。

カルダノの開発は、Plutus、Marlowe、またはGlowでネイティブに行われます。ただし、Cardanoコミュニティは、JavaScriptおよびその他のプログラミング言語で開発するためのSDKを提供しています。

このチュートリアルでは、Cardanocli-jsとCardano-wallet-jsを使用してJavascriptでCardano開発を開始する方法について説明します。

Cardanocli-JSおよびCardanoWalletJSとは何ですか?

Cardanocli-jsは、Cardanoブロックチェーン開発で最も人気のあるjavascriptSDKです。NFTの作成など、Cardanoブロックチェーンで開発する必要のある幅広い機能をサポートします。

Cardano-wallet-jsは、typescriptをサポートするCardanoブロックチェーン開発用のjavascriptSDKです。いくつかの機能とともに、ネイティブトークンとNFTを作成するために使用できます。

この出版物では、ウォレットの作成、ステークプール、Javascriptアプリでのネットワーク情報の取得などのCardanoブロックチェーン機能を統合する方法を学習します。

前提条件

開始するには、これらをコンピュータ/マシンにインストールする必要があります。

  1. NodeJsの公式WebサイトからNodeJsをダウンロードしてインストールします。最新のLTSバージョンのNodeJSをダウンロードすることをお勧めします。
  2. CardanoCli実行可能ファイルをマシンにダウンロードしてインストールします。これは、Cardanoブロックチェーンでクエリおよび開発する必要があるCardanoブロックチェーンノードへの接続に役立つため、CardanoCli-JSSDKの依存関係です。
  3. Cardanocli-JSは、NodeJをインストールした後、次のコマンドを使用してインストールできます。npm install cardanocli-js
  4. Cardano-wallet-jsは、次のnpmコマンドを使用してインストールできます。npm install cardano-wallet-js

Cardano-wallet-jsでは、cardano-walletサーバーが実行されている必要があります。以下のコマンドを実行してdockerを使用してサーバーを起動するか、次の手順に従ってウォレットカルダノウォレットサーバーを起動して実行できます。

wget <https://raw.githubusercontent.com/input-output-hk/cardano-wallet/master/docker-compose.yml>

NETWORK=testnet docker-compose up

お好みのテキストエディタまたはIDEを選択してください。このチュートリアルでは、JetbrainsWebstormを使用します。

これらの設定がすべて完了したら、このチュートリアルのワークスペースにjavascriptファイルを作成します。

私はUbuntuOSを使用していますが、WindowsまたはmacOSを使用している場合は、セットアップにわずかな違いがある可能性があります。

Cardanocli-jsの使用を開始する

Cardanocli-jsを使用してCardanoノードに接続する

IOHKWebサイトのノードビルド番号を取得し ます。ノードビルド番号は、ブラウザでリンクを開いたときのURLの番号です。

ワークスペースにbashスクリプトを作成し、これらのコマンドを入力します。

wget -N <https://hydra.iohk.io/build/${NBM}/download/1/mainnet-shelley-genesis.json>

${NBM}Webサイトのノードビルド番号に置き換え、ターミナルでこのコマンドを使用してbashスクリプトを実行します。

chmod +x fileName.sh

./fileName.sh

1行目は、ファイルを実行可能にするためのアクセス許可を変更し、2行目はファイルを実行して、必要な構成でワークスペースにJSON構成ファイルを作成します。

構成ファイルは、プログラムで指定したメインネットまたはテストネット上のCardanoノードへの接続に役立ちます。

Cardanocli-jsを使用したカルダノ開発

まず、プログラムで使用するためにcardanocli-jsSDKをインポートします。この場合、それはclijsという名前です。

const clijs = require("cardanocli-js")

次に、ネットワーク、構成ファイルのパス、および出力ディレクトリを指定するインポートのインスタンスを作成する必要があります。

const cclijs = new cjs({
network: "mainnet",

directory: __dirname + "output Directory here",

shelleyGenesisPath: __dirname + "config file path here"
})

ネットワークは、ユースケースに応じてメインネットまたはテストネットになります。

このチュートリアルと開発中のメインネットに従って、テストネットを作成できます。

ブロックチェーン接続インスタンスを設定したので、Cardanocli-jsを使用して複数の操作を実行できます

Cardanocli-jsを使用したCardanoウォレットの作成

カルダノウォレットの作成はかなり簡単です。以下に示すように、cardanocli-jsインスタンスのメソッドのパラメーターとしてウォレット名を指定する必要があります。

const createAWallet = (walletName) => {
cclijs.addressKeyGen(walletName)

cclijs.stakeAddressKeyGen(walletName)

cclijs.stakeAddressBuild(walletName)

cclijs.addressBuild(walletName)

return cclijs.wallet(walletName)

}

上記の関数は、関数が呼び出されたときに指定された名前でウォレットを作成します。

console.log(createAWallet('your wallet name here"))

関数がオンチェーンで実行されると、privという名前のディレクトリが、作成したウォレットの秘密鍵と公開鍵を含む、指定した出力フォルダーに作成されます。

Cardanocli-jsを使用したウォレット残高のクエリ

cardanocli-jsインスタンスのwalletメソッドでウォレットの名前を指定することで、ウォレットの残高を照会できます。

const getBalances = (walletName) => {
const query = cardano.wallet(walletName)

return query.balance()
}

上記の関数は、指定されたウォレット名のウォレット残高をJSON形式で返します。

{
utxo : [

    {

        txHash: "7436d178c092222396bd0b5cb71211bd87b098bb9e7e98d1a0f41390c1604711",

        txId: 0,

        amount: [Object]

    }

],

    amount:

{

    lovelace : 350000000

}

上記の出力では、ウォレットにCardanoネイティブアセット$ADAがあると想定されています。

残高はLovelacesで表示され、値を100万で割ることでADAに変換できます。

Cardanocli-jsを使用したステークプールの作成

ステークプールは、Cardanoノードのカスタム名です。Cardanoがプルーフオブステークブロックチェーンであることを除けば、Ethereumノードと同様に動作します。

ステークプールはパブリックまたはプライベートにすることができ、ネットワーク参加者が報酬のためにADAトークンを委任できるパブリックアドレスを持っています。

Cardanocli-jsを使用してステークプールを作成するのは簡単で、ウォレットを作成するのと同じです。

const createAStakePool = (poolName) => {
cclijs.nodeKeyGenKES(poolName);

cclijs.nodeKeyGen(poolName);

cclijs.nodeIssueOpCert(poolName);

cclijs.nodeKeyGenVRF(poolName);

return cclijs.pool(poolName);
};

上記の関数は、指定した名前に関連付けられたステークプールを作成し、関数と同じように指定したディレクトリにファイルを出力しますcreateAWallet。この関数は、呼び出されたときにプール名を返します。

console.log(createAWallet('your stakepool name here"))

これでCardanoステークプールが正常に作成され、上記のウォレットを作成したときと同じように、ファイルが出力ディレクトリに作成されました。

Cardano-wallet-js入門

Cardano-wallet-jsをインストールしたら、インポートして使用できます。

const { seed, WalletServer: walletserver } = require('cardano-wallet-js');

let walletServer = WalletServer.init('Your wallet server host URL');

ウォレットサーバーインスタンスは、ウォレットサーバーへのリンクを使用して作成および初期化されます。シードはウォレットの作成に使用されます。

Cardano-wallet-jsを使用したウォレットの作成

Cardano-wallet-jsを使用してCardanoウォレットを作成することは、Cardanocli-jsよりも実用的です。以下の機能を使用してウォレットを作成できます。

let recoveryPhrase = seed.generateRecoveryPhrase()

let passPhrase = "name"

let walletName = "name"

let wallet = await walletServer.createOrRestoreShelleyWallet(walletName, mnemonic, passPhrase)

console.log(seed.toMnemonicList(recoveryPhrase))

上記のコードでは、シードを使用してリカバリフレーズを生成し、次に変数passPhrasewalletName変数を作成して、カルダノシェリーウォレットを作成または復元するウォレット変数に渡します。

最後の行は、ニーモニックのリストをコンソールに記録します。Shelly時代のウォレットのニーモニックは24ワードです。

カルダノブロックチェーン情報のクエリ

getNetworkInformation作成したウォレットサーバーインスタンスのメソッドを使用して、Cardanoブロックチェーンの状態を照会できます。

let query = await walletServer.getNetworkInformation()

console.log(query)

これにより、ネットワークステータス、ノード情報、ブロックチェーン同期の進行状況、エポック情報などのさまざまなパラメーターを含むJSONが出力され、そこから必要な特定のデータを選択できます。

ウォレットアドレストランザクションのクエリ

多くの場合、ウォレットアドレスのトランザクションを照会すると便利です。getTransactionsこれは、ウォレットインスタンスのメソッドを使用して行うことができます。

let transactions = await wallet.getTransactions();

console.log(transactions)

メソッドに日付範囲を渡してgetTransactions、特定の日付範囲のトランザクションを選択できます。

特定のトランザクションの詳細のクエリ

特定のトランザクションの詳細を照会する機能は、トランザクションのトランザクションIDを渡すことによって実行できます。

let transaction = await wallet.getTransaction("transaction id");

トランザクションIDは、トランザクションの完了後に割り当てられたランダムな文字列のセットであり、ウォレットまたはブロックチェーンプロバイダーからコピーできます。

結論

Cardanocli-jsおよびCardano-wallet-jsSDKを使用すると、ブロックチェーンと対話するためのPlutus、Marlowe Glow、またはBashスクリプトを作成する代わりに、Javascriptを使用してCardanoブロックチェーンと簡単に対話できます。

ただし、現時点では、CardanoネイティブのスマートコントラクトをJavaScriptで記述することはできません。Cardanocli-jsおよびCardano-wallet-jsSDKは、必要に応じてWeb3.0およびWeb2.0プロジェクトに統合できます。

ソース:https ://blog.logrocket.com/interacting-cardano-blockchain-using-javascript/

#blockchain #javascript #cardano

JavaScriptを使用したCardanoブロックチェーンとの対話
steve joseph

steve joseph

1655286921

Buy, Sell and Trade Cardano (ADA) on Koinbazar

Cardano (ADA)

Cardano is a digital currency that is designed to offer more scalability and better security than its predecessors.
The project was first introduced in September 2017 by Input Output Hong Kong (IOHK), a leading blockchain development company that focuses on emerging applications such as ADA.

Cardano runs on blockchain and is the first open-source cryptocurrency created from a scientific philosophy. Emphasis was given to interoperability between ledgers, delivering both security and scalability. This goal of Cardano is to be created as an environment for decentralized applications to run with smart contracts interfacing with one another via side chains.

Uses of Cardano:

Cardano is a decentralized computing platform that uses the blockchain to offer a range of capabilities in terms of security, scalability, and sustainability. The Cardano platform is home to many Dapps and smart contracts which provide various use cases for a broad spectrum of individuals and organizations.

The decentralized nature ensures that there are no intermediaries involved in the transactions which happen on the platform. This prevents any third parties from tampering with the data because it is cryptographically secured by blockchain technology. The certainty provided by this distributed ledger system also fosters trust among stakeholders in transactions related to financial transactions, voting systems, supply chains, etc. The presence of a regulatory-compliant framework also provides an increased sense of security among users and potential investors.

Interesting facts about Cardano:

Cardano was founded by Charles Hoskinson, a former CEO and co-founder of Ethereum.

Cardano is a blockchain tech that provides financial services to people, running on blockchain technology. It is built using peer-to-peer technology, open-source software as well as consensus mechanisms.

Cardano focuses on security with the use of Haskell programming language and cryptographic techniques like formal verification and proof of stake.

It uses the ADA coin which is one of the leading currencies in the cryptocurrency market with a cap of $2 billion dollars, it has a price value of $0.3092 at the moment

Cardano is ranked third among all cryptocurrencies in the world today

It has grown more than 3000% since this summer

It ranks 8th position for its market capitalization

Tokenomics :

Token Name: Cardano

Short Name: ADA

Total Supply : 34,277,702,082

Circulating Supply: 33.93B

How to buy Cardano (ADA) ?

Follow the below steps to buy Cardano,

1. Create a crypto trading account with Koinbazar global cryptocurrency exchange platform

2. Complete your KYC Verification Process

3. Add your Bank Account

4. Start to buy Cardano with Bitcoin (BTC), Ethereum (ETH), Indian Rupee (INR), and Tether (USDT)

ADA/BTC -> https://koinbazar.com/trade/ADA_BTC

ADA/ETH -> https://koinbazar.com/trade/ADA_ETH

ADA/INR -> https://koinbazar.com/trade/ADA_INR

ADA/USDT -> https://koinbazar.com/trade/ADA_USDT

To Make your Cardano trade anywhere, anytime with the great trading experience with Koinbazar Android and iOS app.


#crypto #cryptos #cryptocurrency #cardano #ada 

Buy, Sell and Trade Cardano (ADA) on Koinbazar

Buy, Sell and Trade Cardano (ADA) on Koinbazar

Cardano (ADA)

Cardano is a digital currency which is designed to offer more scalability and better security than its predecessors.
The project was first introduced in September 2017 by Input Output Hong Kong (IOHK), a leading blockchain development company that focuses on emerging applications such as ADA.

Cardano runs on blockchain and is the first open-source cryptocurrency created from a scientific philosophy. Emphasis was given to interoperability between ledgers, delivering both security and scalability. This goal of Cardano is to be created as an environment for decentralized applications to run with smart contracts interfacing with one another via side chains.

Uses of Cardano:

Cardano is a decentralized computing platform that uses the blockchain to offer a range of capabilities in terms of security, scalability, and sustainability. The Cardano platform is home to many Dapps and smart contracts which provide various use cases for a broad spectrum of individuals and organizations.

The decentralized nature ensures that there are no intermediaries involved in the transactions which happen on the platform. This prevents any third parties from tampering with the data because it is cryptographically secured by blockchain technology. The certainty provided by this distributed ledger system also fosters trust among stakeholders in transactions related to financial transactions, voting systems, supply chains etc. The presence of regulatory-compliant framework also provides an increased sense of security among users and potential investors.

Interesting facts about Cardano:

Cardano was founded by Charles Hoskinson, a former CEO and co-founder of Ethereum.

Cardano is a blockchain tech that provides financial services to people, running on blockchain technology. It is built using peer-to-peer technology, open source software as well as consensus mechanisms.

Cardano focuses on security with the use of Haskell programming language and cryptographic techniques like formal verification and proof of stake.

It uses ADA coin which is one of the leading currencies in the cryptocurrency market with a cap of $2 billion dollars, it has a price value of $0.3092 at the moment

Cardano is ranked third among all cryptocurrencies in the world today

It has grown more than 3000% since this summer

It ranks 8th position for its market capitalization

Tokenomics :

Token Name : Cardano

Short Name :  ADA

Total Supply : 34,277,702,082

Circulating Supply:  33.93B

How to buy Cardano (ADA) ?

Follow the below steps to buy Cardano,

1. Create a crypto trading account with Koinbazar global cryptocurrency exchange platform

2. Complete your KYC Verification Process

3. Add your Bank Account

4. Start to buy Cardano with Bitcoin (BTC), Ethereum (ETH), Indian Rupee (INR) and Tether (USDT)

ADA/BTC  ->  https://koinbazar.com/trade/ADA_BTC

ADA/ETH  -> https://koinbazar.com/trade/ADA_ETH

ADA/INR  -> https://koinbazar.com/trade/ADA_INR

ADA/USDT  ->  https://koinbazar.com/trade/ADA_USDT

To Make your Cardano trade anywhere, anytime with the great trading experience with Koinbazar Android and iOS app.

#cardano #ada #cryptocurrency #crypto #cryptos #cryptocurrencies 

Buy, Sell and Trade Cardano (ADA) on Koinbazar

What is Cardano? Crypto Customer Care

What is Cardano?

If you want to know what is Cardano then you go to our website you will get complete information.

Visit website🌐👇
https://www.cryptocustomercare.org/what-is-cardano/

#cardano #cryptocurrecy #Cryptos

What is Cardano? Crypto Customer Care
Saul  Alaniz

Saul Alaniz

1650173460

Cómo Construir DApps En La Cadena De Bloques De Cardano

La cadena de bloques de Cardano es una de las cadenas de bloques de más rápido crecimiento y más utilizadas en 2022. La cadena de bloques de Cardano es una plataforma de cadena de bloques de prueba de participación de tercera generación y alberga la criptomoneda ADA.

En este tutorial, le mostraremos cómo crear una DApp en la cadena de bloques de Cardano.

Empecemos 🎉

¿Qué es Cardano?

La cadena de bloques de Cardano es una nueva cadena de bloques basada en el algoritmo de consenso de Shelley . Está diseñado para ser una plataforma segura, escalable y fácil de usar para crear y ejecutar aplicaciones descentralizadas.

Shelley es una pila de software que proporciona una capa de abstracción sobre las cadenas de bloques subyacentes.

¿Qué es una cadena de bloques?

Una cadena de bloques es una base de datos distribuida de registros unidos entre sí por una serie de pruebas criptográficas. Los registros se denominan bloques; la cadena de bloques es una colección de bloques.

Ethereum es una cadena de bloques que se basa en la máquina virtual de Ethereum . Para realizar transacciones en la cadena de bloques de Ethereum, gastaremos algunos Ethers. Esta es la criptomoneda que se utiliza para pagar el gas en la cadena de bloques de Ethereum.

Del mismo modo, en la cadena de bloques de Cardano, gastaremos ADA para pagar las tarifas del gas.

¿Qué son las DApps?

Una aplicación distribuida y descentralizada es una aplicación que no está controlada por una sola entidad. De lo contrario, una DApp es como cualquier aplicación convencional. Una DApp puede ser una aplicación web, una aplicación de línea de comandos, una aplicación de escritorio o un dispositivo móvil.

La diferencia entre una DApp y una aplicación convencional es que la aplicación convencional está controlada por una sola entidad. Una DApp tiene una cadena de bloques como backend.

Por ejemplo, una aplicación de tareas pendientes de React podría tener sus datos (las tareas pendientes) almacenados en una cadena de bloques de Ethereum. O bien, podría crear un sistema de votación en Angular y tener sus datos almacenados en la cadena de bloques de Cardano.

¿Qué es ADA?

Como se mencionó anteriormente, ADA es la criptomoneda nativa de la cadena de bloques de Cardano. Puede usar y transferir ADA en la cadena de bloques de Cardano tal como lo haría con ETH en la cadena de bloques de Ethereum.

ADA se puede usar como criptomoneda y como token. El uso de ADA como moneda nativa de Cardano significa que es:

  • Aceptado como pago de cuota
  • Aceptado para hacer depósitos
  • La única moneda en la que se distribuyen las recompensas

Al igual que ETH se divide en denominaciones (p. ej., Wei), ADA también tiene denominaciones. Lovelace es la unidad más pequeña de ADA; 1 ADA es igual a 10^(-18) Lovelace, que se puede dividir en un total de 1,000,000 Lovelaces.

Cardano y tokens nativos

La cadena de bloques de Cardano hace posible construir tokens nativos. Estos tokens se pueden usar para representar un valor y comerciar en la cadena de bloques de Cardano.

Los tokens pueden ser fungibles o no fungibles. Las fichas fungibles representan un valor, mientras que las fichas no fungibles representan elementos del mundo real (por ejemplo, un automóvil o una obra de arte).

En las siguientes secciones, veremos cómo escribir y crear contratos inteligentes en la cadena de bloques de Cardano utilizando el lenguaje de programación Plutus.

¿Qué es Pluto?

Plutus es un lenguaje de programación utilizado para escribir contratos inteligentes en la cadena de bloques de Cardano. Otros lenguajes de programación que puede usar para la cadena de bloques de Cardano incluyen Glow lang , Marlowe , etc., pero Plutus es el más rápido entre ellos.

Plutus se basa en Haskell, por lo que su uso requiere un conocimiento previo de la programación de Haskell.

Escribir contratos inteligentes usando Plutus

Veamos cómo escribir contratos inteligentes utilizando el lenguaje de programación Plutus. Estas aplicaciones pueden ejecutarse fuera de la cadena y administrar instancias de contratos activos.

Según Cardano Testnets , los contratos de Plutus consisten en partes que se ejecutan en blockchain (código en cadena) y partes que se ejecutan en la máquina de un usuario (fuera de cadena o código de cliente). Escribiremos nuestros contratos inteligentes en un editor y simulador en línea de Plutus .

Un contrato inteligente de Plutus es un código de Haskell que se ejecuta en la billetera de un usuario y envía el código a la cadena de bloques para que lo ejecuten los nodos de la cadena de bloques. Los contratos inteligentes se ejecutan en la cadena de bloques, no en la máquina del usuario.

Los contratos inteligentes de Plutus tienen definiciones que se utilizan para definir el contrato inteligente y su estado. Dentro de estas definiciones hay puntos finales, que definen el comportamiento del contrato inteligente. Estos puntos finales son funciones que ejecuta la billetera. Se conocen como funciones fuera de la cadena y se utilizan para generar transacciones y enviarlas a la cadena de bloques.

Ejemplo: Escribir un "¡Hola, mundo!" aplicación en Plutus

Escribamos una DApp simple en la cadena de bloques de Cardano usando el lenguaje de programación Plutus.

Escribiremos un contrato inteligente que imprimirá "¡Hola, mundo!" a la consola

Abra el editor y simulador en línea de Plutus .

import Data.Text qualified as T
import Playground.Contract
import Plutus.Contract
import PlutusTx.Prelude
import Prelude qualified as Haskell

-- | A 'Contract' that logs a message.
hello :: Contract () EmptySchema T.Text ()
hello = logInfo @Haskell.String "Hello, world"

endpoints :: Contract () EmptySchema T.Text ()
endpoints = hello

type DummySchema = Endpoint "dummy" ()

mkSchemaDefinitions ''DummySchema

$(mkKnownCurrencies [])

Lo anterior ya estará poblado para nosotros. Repasemos el código:

import Data.Text qualified as T
import Playground.Contract
import Plutus.Contract
import PlutusTx.Prelude
import Prelude qualified as Haskell

Aquí, importamos las bibliotecas y las funciones integradas que necesitaremos:

  • La Data.Textbiblioteca se utiliza para convertir cadenas en texto.
  • Las Playground.Contractimportaciones de las interfaces de contratos inteligentes definidas en el patio de recreo
  • La Plutus.Contractbiblioteca se utiliza para definir el contrato inteligente de la biblioteca principal de Plutus
  • La PlutusTx.Preludebiblioteca reemplaza la biblioteca Haskell Prelude normal e incluye funciones que son refinadas y más fáciles de PlutusTxcompilar para el compilador.
hello :: Contract () EmptySchema T.Text ()
hello = logInfo @Haskell.String "Hello, world"

Lo anterior define una hellofunción. El Contract () EmptySchema T.Text ()le dice al compilador que la función no devolverá nada. La logInfofunción es una función integrada que registra un mensaje en la consola. Entonces, en resumen. la hellofunción se registrará Hello, worlden la consola.

endpoints :: Contract () EmptySchema T.Text ()
endpoints = hello

Esto crea una endpointsfunción, que se utilizará para ejecutar la hellofunción. Esto expone la hellofunción a la cadena de bloques.

type DummySchema = Endpoint "dummy" ()

mkSchemaDefinitions ''DummySchema

$(mkKnownCurrencies [])

Lo anterior crea el DummySchematipo, que se utiliza para definir el estado del contrato inteligente. Finalmente, expone los puntos finales a la cadena de bloques.

En nuestro patio de juegos de Plutus, podemos hacer clic en el botón verde Compilar para compilar nuestros contratos. El botón azul Simular abrirá una página donde podemos ejecutar los contratos inteligentes en la cadena de bloques.

Haga clic en el botón verde Compilar . Después de una compilación exitosa, el botón azul Simular abrirá una página donde podemos ejecutar los contratos inteligentes en la cadena de bloques:

Notarás que tenemos dos billeteras, cada una con un saldo abierto de 100 Lovelaces. El Available functionsen cada billetera mostrará las funciones que están disponibles para ser utilizadas.

En nuestro caso, vemos nuestra hellofunción y otra Pay to Walletfunción. La Pay to Walletfunción se usa para enviar fondos a otra billetera y está definida por el contrato de Plutus. No podemos ver el código porque se agrega allí cuando importamos los siguientes módulos:

import Playground.Contract
import Plutus.Contract

Si miramos en la parte inferior de la página, veremos una sección de Acciones  . Esta sección es donde se agregan las funciones que queremos ejecutar cuando se hace clic en la tarjeta de direcciones de billetera anterior.

Ya tenemos una tarjeta en Acciones , la tarjeta simula un retraso en la cadena de bloques. Podemos eliminar esta tarjeta haciendo clic en el icono “X”.

Ahora, haga clic en el botón ficticio y verá que aparece una tarjeta en la sección Acciones :

Haga clic en el botón verde Evaluar y verá que la hellofunción se ejecuta en la cadena de bloques. Después de un tiempo, Transactionsaparecerá una página:

Desplácese hacia abajo hasta la sección Registros y verá el helloregistro Hello, worldde funciones en la consola:

Ejemplo: Uso de la sayInputfunción

Escribamos otro programa que tome una cadena y la imprima en la consola.

Agregue el siguiente código a su editor en línea de Plutus:

import Data.Text qualified as T
import Playground.Contract
import Plutus.Contract
import PlutusTx.Prelude
import Prelude qualified as Haskell

type Schema =
        Endpoint "sayInput" Haskell.String

contract :: AsContractError e => Contract () Schema e ()
contract = selectList [sayInput]

-- | The "sayInput" contract endpoint.
sayInput :: AsContractError e => Promise () Schema e ()
sayInput = endpoint @"sayInput" $ \inputValue -> do
    logInfo @Haskell.String $ inputValue

endpoints :: AsContractError e => Contract () Schema e ()
endpoints = contract

mkSchemaDefinitions ''Schema

$(mkKnownCurrencies [])

Ya hemos visto la primera parte del código; aquí, importamos las bibliotecas que necesitamos para ejecutar la aplicación.

A continuación, definimos un Schematipo. Este tipo se utiliza para definir el estado del contrato inteligente. Después de eso, configuramos una lista de puntos finales del contrato y agregamos el sayInputpunto final.

También definimos el sayInputpunto final, que toma una cadena como entrada y la registra en la consola.

Finalmente, pusimos el punto final a disposición de la cadena de bloques.

Haga clic en el botón verde Compilar . Después de una compilación exitosa, debería ver esto:

Haga clic en el botón azul Simular . Esto abrirá una página donde podemos ejecutar los contratos inteligentes en la cadena de bloques.

Tenga en cuenta que tenemos la sayInputfunción en las direcciones de billetera. Haz click en eso.

La sayInputfunción aparecerá en la sección Acciones :

Ahora, escriba cualquier cadena en el campo de entrada y haga clic en el Evaluatebotón:

Verá la cadena que escribió en la Transactionspágina.

Conclusión

En este tutorial, demostramos cómo escribir una DApp en la cadena de bloques de Cardano utilizando el lenguaje de programación Plutus.

Comenzamos presentando la cadena de bloques de Cardano y el lenguaje de programación Plutus. A continuación, explicamos Cardano comparándolo con la cadena de bloques de Ethereum. Luego presentamos el lenguaje de programación Plutus y describimos cómo podemos usarlo para compilar y ejecutar contratos inteligentes en la cadena de bloques de Cardano.

Finalmente, analizamos algunos ejemplos de contratos inteligentes escritos en el lenguaje de programación Plutus y ejecutados en una cadena de bloques Cardano simulada. 

Fuente: https://blog.logrocket.com/how-to-build-dapps-cardano-blockchain/

#dapp #cardano #blockchain #plutus 

Cómo Construir DApps En La Cadena De Bloques De Cardano

CardanoブロックチェーンでDAppを構築する

Cardanoブロックチェーンは、2022年に最も急成長し、最も広く使用されているブロックチェーンの1つです。Cardanoブロックチェーンは、第3世代のプルーフ・オブ・ステークブロックチェーンプラットフォームであり、ADA暗号通貨の本拠地です。

このチュートリアルでは、Cardanoブロックチェーン上にDAppを構築する方法を示します。

始めましょう🎉

カルダノとは何ですか?

Cardanoブロックチェーンは、Shelleyコンセンサスアルゴリズムに基づく新しいブロックチェーンです。分散型アプリケーションを構築および実行するための、安全でスケーラブルで使いやすいプラットフォームになるように設計されています。

Shelleyは、基盤となるブロックチェーン上に抽象化レイヤーを提供するソフトウェアスタックです。

ブロックチェーンとは何ですか?

ブロックチェーンは、一連の暗号化証明によって相互にリンクされたレコードの分散データベースです。レコードはブロックと呼ばれます。ブロックチェーンはブロックのコレクションです。

イーサリアムは、イーサリアム仮想マシンに基づくブロックチェーンです。イーサリアムブロックチェーンでトランザクションを行うために、いくつかのイーサリアムを使います。これは、イーサリアムブロックチェーンのガスの支払いに使用される暗号通貨です。

同様に、カルダノブロックチェーンでは、ガス料金の支払いにADAを使用します。

DAppとは何ですか?

分散型の分散型アプリは、単一のエンティティによって制御されないアプリケーションです。それ以外の点では、DAppは従来のアプリとまったく同じです。DAppは、Webアプリ、コマンドラインアプリ、デスクトップアプリ、またはモバイルにすることができます。

DAppと従来のアプリの違いは、従来のアプリが単一のエンティティによって制御されることです。DAppには、バックエンドとしてブロックチェーンがあります。

たとえば、React to-doアプリのデータ(to-do)がEthereumブロックチェーンに保存されている場合があります。または、Angularで投票システムを構築し、そのデータをCardanoブロックチェーンに保存することもできます。

ADAとは何ですか?

上記のように、ADAはCardanoブロックチェーンのネイティブ暗号通貨です。イーサリアムブロックチェーンでETHを実行するのと同じように、カルダノブロックチェーンでADAを使用および転送できます。

ADAは暗号通貨とトークンの両方として使用できます。カルダノの自国通貨として使用されているADAは、次のことを意味します。

  • 手数料の支払いとして受け入れられます
  • 入金を受け付けました
  • 報酬が分配される唯一の通貨

ETHが宗派(例:Wei)に分割されているように、ADAにも宗派があります。LovelaceはADAの最小単位です。1ADAは10^(-18)Lovelaceに等しく、合計1,000,000のLovelaceに分割できます。

カルダノとネイティブトークン

Cardanoブロックチェーンは、ネイティブトークンの構築を可能にします。これらのトークンは、値を表し、Cardanoブロックチェーンで取引するために使用できます。

トークンは代替可能または代替不可能にすることができます。代替可能トークンは値を表しますが、非代替トークンは実世界のアイテム(たとえば、車やアートワーク)を表します。

次のセクションでは、Plutusプログラミング言語を使用してCardanoブロックチェーンでスマートコントラクトを作成および作成する方法について説明します。

プルートスとは何ですか?

Plutusは、Cardanoブロックチェーンでスマートコントラクトを作成するために使用されるプログラミング言語です。Cardanoブロックチェーンに使用できる他のプログラミング言語には、Glow langMarloweなどがありますが、その中でPlutusが最速です。

PlutusはHaskellに基づいているため、Plutusを使用するには、Haskellプログラミングの予備知識が必要です。

Plutusを使用してスマートコントラクトを作成する

Plutusプログラミング言語を使用してスマートコントラクトを作成する方法を見ていきましょう。これらのアプリは、オフチェーンで実行し、アクティブなコントラクトインスタンスを管理できます。

Cardano Testnetsによると、Plutusコントラクトは、ブロックチェーンで実行されるパーツ(オンチェーンコード)とユーザーのマシンで実行されるパーツ(オフチェーンまたはクライアントコード)で構成されます。Plutusオンラインエディターとシミュレーターでスマートコントラクトを作成します。

Plutusスマートコントラクトは、ユーザーのウォレットで実行され、ブロックチェーン内のノードによって実行されるコードをブロックチェーンに送信するHaskellコードです。スマートコントラクトは、ユーザーのマシンではなく、ブロックチェーンで実行されます。

Plutusスマートコントラクトには、スマートコントラクトとその状態を定義するために使用される定義があります。これらの定義の中には、スマートコントラクトの動作を定義するエンドポイントがあります。これらのエンドポイントは、ウォレットによって実行される機能です。これらはオフチェーン関数と呼ばれ、トランザクションを構築してブロックチェーンに送信するために使用されます。

例:「Hello、World!」を書く Plutusのアプリ

Plutusプログラミング言語を使用して、Cardanoブロックチェーンに簡単なDAppを記述してみましょう。

「Hello、World!」を印刷するスマートコントラクトを作成します。コンソールに。

Plutusオンラインエディターとシミュレーターを開きます。

import Data.Text qualified as T
import Playground.Contract
import Plutus.Contract
import PlutusTx.Prelude
import Prelude qualified as Haskell

-- | A 'Contract' that logs a message.
hello :: Contract () EmptySchema T.Text ()
hello = logInfo @Haskell.String "Hello, world"

endpoints :: Contract () EmptySchema T.Text ()
endpoints = hello

type DummySchema = Endpoint "dummy" ()

mkSchemaDefinitions ''DummySchema

$(mkKnownCurrencies [])

上記はすでに入力されています。コードを見てみましょう:

import Data.Text qualified as T
import Playground.Contract
import Plutus.Contract
import PlutusTx.Prelude
import Prelude qualified as Haskell

ここでは、必要なライブラリと組み込み関数をインポートしました。

  • ライブラリは、Data.Text文字列をテキストに変換するために使用されます
  • Playground.Contract遊び場で定義されたスマートコントラクトインターフェイスをインポートします
  • Plutus.Contractライブラリは、Plutusコアライブラリからスマートコントラクトを定義するために使用されます
  • このPlutusTx.Preludeライブラリは、通常のHaskell Preludeライブラリに置き換わるものであり、PlutusTxコンパイラがコンパイルしやすいように洗練された関数が含まれています。
hello :: Contract () EmptySchema T.Text ()
hello = logInfo @Haskell.String "Hello, world"

上記はhello関数を定義します。はContract () EmptySchema T.Text ()、関数が何も返さないことをコンパイラーに通知します。このlogInfo関数は、コンソールにメッセージを記録する組み込み関数です。要約すると、hello関数はHello, worldコンソールにログを記録します。

endpoints :: Contract () EmptySchema T.Text ()
endpoints = hello

これにより、endpoints関数を実行するために使用される関数が作成されhelloます。helloこれにより、関数がブロックチェーンに公開されます。

type DummySchema = Endpoint "dummy" ()

mkSchemaDefinitions ''DummySchema

$(mkKnownCurrencies [])

上記はDummySchema、スマートコントラクトの状態を定義するために使用されるタイプを作成します。最後に、エンドポイントをブロックチェーンに公開します。

Plutusプレイグラウンドでは、緑色の[コンパイル]ボタンをクリックして、契約をコンパイルできます。青い[シミュレーション]ボタンをクリックすると、ブロックチェーンでスマートコントラクトを実行できるページが開きます。

緑色の[コンパイル]ボタンをクリックします。コンパイルが成功すると、青い[シミュレーション]ボタンをクリックすると、ブロックチェーンでスマートコントラクトを実行できるページが開きます。

2つのウォレットがあり、それぞれに100個のラブレースのオープンバランスがあります。各Available functionsウォレットには、使用可能な機能が表示されます。

私たちの場合、私たちのhello関数と別のPay to Wallet関数が表示されます。このPay to Wallet関数は、別のウォレットに資金を送るために使用され、Plutusコントラクトによって定義されます。以下のモジュールをインポートするとコードが追加されるため、コードは表示されません。

import Playground.Contract
import Plutus.Contract

ページの下の部分を見ると、[アクション] セクションが表示されます。このセクションでは、上のウォレットアドレスカードをクリックすると、実行したい機能が追加されます。

アクションにはすでにカードがあり、そのカードはブロックチェーンの遅延をシミュレートします。「X」アイコンをクリックすると、このカードを削除できます。

次に、ダミーボタンをクリックすると、[アクション]セクションにカードが表示されます。

緑色の[評価]ボタンをクリックhelloすると、ブロックチェーンで実行されている関数が表示されます。しばらくすると、次のTransactionsページが表示されます。

[ログ]セクションまで下にスクロールすると、コンソールへのhello機能ログが表示されます。Hello, world

例:sayInput関数の使用

文字列を取得してコンソールに出力する別のプログラムを作成してみましょう。

以下のコードをPlutusオンラインエディターに追加します。

import Data.Text qualified as T
import Playground.Contract
import Plutus.Contract
import PlutusTx.Prelude
import Prelude qualified as Haskell

type Schema =
        Endpoint "sayInput" Haskell.String

contract :: AsContractError e => Contract () Schema e ()
contract = selectList [sayInput]

-- | The "sayInput" contract endpoint.
sayInput :: AsContractError e => Promise () Schema e ()
sayInput = endpoint @"sayInput" $ \inputValue -> do
    logInfo @Haskell.String $ inputValue

endpoints :: AsContractError e => Contract () Schema e ()
endpoints = contract

mkSchemaDefinitions ''Schema

$(mkKnownCurrencies [])

コードの最初の部分はすでに見てきました。ここでは、アプリを実行するために必要なライブラリをインポートしました。

次に、Schemaタイプを定義しました。このタイプは、スマートコントラクトの状態を定義するために使用されます。その後、契約エンドポイントリストを設定し、エンドポイントを追加しましたsayInput

sayInputまた、文字列を入力として受け取り、それをコンソールに記録するエンドポイントも定義しました。

最後に、エンドポイントをブロックチェーンで利用できるようにしました。

緑色の[コンパイル]ボタンをクリックします。コンパイルが成功すると、次のように表示されます。

青い[シミュレーション]ボタンをクリックします。これにより、ブロックチェーンでスマートコントラクトを実行できるページが開きます。

sayInputウォレットアドレスに関数があることに注意してください。クリックして。

sayInput関数は[アクション]セクションに表示されます

次に、入力フィールドに任意の文字列を入力して、Evaluateボタンをクリックします。

ページに入力した文字列が表示されTransactionsます。

結論

このチュートリアルでは、Plutusプログラミング言語を使用してCardanoブロックチェーンにDAppを作成する方法を示しました。

まず、CardanoブロックチェーンとPlutusプログラミング言語を紹介しました。次に、カルダノをイーサリアムブロックチェーンと比較して説明しました。次に、Plutusプログラミング言語を紹介し、それを使用してCardanoブロックチェーンでスマートコントラクトをコンパイルおよび実行する方法について説明しました。

最後に、Plutusプログラミング言語で記述され、シミュレートされたCardanoブロックチェーンで実行されるスマートコントラクトの例をいくつか紹介しました。 

ソース:https ://blog.logrocket.com/how-to-build-dapps-cardano-blockchain/

#dapp #cardano #blockchain #plutus 

CardanoブロックチェーンでDAppを構築する
Callum  Owen

Callum Owen

1649998080

What is Cardano (ADA) and How It Works ?

What is Cardano? Cardano is a blockchain created with the help of Charles Hoskinson to solve 3 main problems he saw in other blockchains. Learn what those problems are and how they are solved with Cardano in this video!

#blockchain #cardano #ada 

What is Cardano (ADA) and How It Works ?
Awesome  Rust

Awesome Rust

1646977860

Cardano Cli: Cardano Command Line interface (CLI)

Deprecated Note:

This repository implements supports for Cardano Byron, and will not be updated to works on Cardano Shelley and further.

cardano-cli

The Cardano command line interface provides the following features:

  • powerful blockchain manager: with download, explore, verify, and analyze functions
  • ability to manage multiple wallets: Daedalus', Icarus' or custom wallets
  • flexible transaction build engine

This command line interface is built upon the Rust Cardano SDK.

Warning

  • The software is currently still in alpha phase, please do not use for any other purpose than debugging and testing, until stable releases are available.
  • While most of the operations in the CLI is in a reading state, and are thus relatively safe even in the presence of bugs, do take special note that transaction send will permanently change your state.
  • It ia advisable to trial testnet operations (depending on testnet availability), prior to completing mainnet operations.
  • If you think something is suspicious, it may very well be the case. Check the documentation, or ask for help.
  • Do not share your wallet mnemonics, passwords, cryptographic material, or pending signatures.

Installation guide

While it is recommended to wait for official releases, it is also possible to build the executable yourself by following these steps:

  1. install rust toolchain;
  2. clone the project repository (with the dependencies)
git clone https://github.com/input-output-hk/cardano-cli.git --recursive

3.    build and install the binary:

cd cardano-cli
cargo install

4.    enjoy

Usage

Quick start

$ cardano-cli blockchain new mainnet
$ cardano-cli blockchain pull mainnet
$ cardano-cli wallet create "My Wallet"
$ cardano-cli wallet attach "My Wallet" mainnet
$ cardano-cli wallet sync   "My Wallet"
$ cardano-cli wallet status "My Wallet"

Complete documentation

Command line documentation

Supported platforms

Targettest
aarch64-unknown-linux-gnu
arm-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
i686-unknown-linux-gnu
i686-unknown-linux-musl
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
i686-apple-darwin
x86_64-apple-darwin
x86_64-apple-darwin
i686-unknown-freebsd
x86_64-unknown-freebsd

Supported compiler versions

Rusttest
stable
beta
nightly

We aim to support compiler versions as far as version 1.30. However, this is not a contract. Support of older compiler versions may be dropped in the future as we see fit.

Download Details:
Author: input-output-hk
Source Code: https://github.com/input-output-hk/cardano-cli
License: View license

#rust  #blockchain #cardano 

Cardano Cli: Cardano Command Line interface (CLI)