SlideShare a Scribd company logo
1 of 13
Download to read offline
5. TestRPC and Remix
KC Tam
Reach KC on LinkedIn: https://www.linkedin.com/in/ktam1/
Objective
TestRPC is a more common in-memory Ethereum
Environment for Solidity Contract Development. Here we will
explore how to start TestRPC and to access TestRPC from
Remix.
Remix supports three Ethereum Environments when
running a contract.
Remix Ethereum Environment
JavaScript VM Injected Web3 Web3 Provider
Remix in-memory Ethereum
Network, running inside
Remix.
Working with injected Web3
such as Mist and Metamask
Interacting with localhost
through RPC
Mainnet
Testnet(s)
TestRPCPrivate Net
If localhost provides RPC interface, Remix can
connect to these Ethereum networks.
Here we focus on TestRPC.
The most common RPC interface is on
http://localhost:8545, but is configurable.
Local host
TestRPC
Remix
http://localhost:8545
A common in-memory Ethereum
environment for contract and DApp
development
Comes with 10 accounts with 100 ethers
predeposited
Mnemonic hierarchical deterministic
wallet
Note: It is renamed to ganache-cli recently by Truffle, the maintainer, but we keep
using TestRPC in this deck.
TestRPC
After running TestRPC, 10 accounts are
created, with both address and private
key.
$ testrpc
New set of 10 accounts are created
when running TestRPC next time.
To keep the same set of address, use
the mnemonic
$ testrpc -m "<mnemonic>"
TestRPC is listening on localhost:8545
With TestRPC running, select Web3 Provider in Remix.
Remix requests the Web3 Provider Endpoint, which is the rpc interface on
the Ethereum Network. As we notice, TestRPC is already "Listening on
localhost: 8545". Click OK to continue.
Environment is set to Web3 Provider, and from Accounts we see the 10 accounts from TestRPC.
Now we can use Remix as before: deploying contract and executing
functions. The difference is that now we are acting on TestRPC Ethereum
Network.
Note the output on TestRPC terminal and we start understanding what
happens when contract is deployed and functions are executed.
When create a contract, we see a transaction is issued to TestRPC. The Contract created matches the
contract address shown in Remix 0xbd5…eb764.
When set function is executed, it is another transaction Remix issues on TestRPC.
Summary
TestRPC is a more commonly used Ethereum environment
for contract and DApp development. While there is no
difference on Remix side, with TestRPC we can see what
happens when contract is deployed and function is executed.

More Related Content

What's hot

Networking in Gnu/Linux
Networking in Gnu/LinuxNetworking in Gnu/Linux
Networking in Gnu/Linux
Ahmed Mekkawy
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
Iker Coranti
 

What's hot (12)

Networking in Gnu/Linux
Networking in Gnu/LinuxNetworking in Gnu/Linux
Networking in Gnu/Linux
 
Pandora FMS: Sun One webserver
Pandora FMS: Sun One webserverPandora FMS: Sun One webserver
Pandora FMS: Sun One webserver
 
Automate Cisco Switch Configuration Backups with KRON
Automate Cisco Switch Configuration Backups with KRONAutomate Cisco Switch Configuration Backups with KRON
Automate Cisco Switch Configuration Backups with KRON
 
Kafka Workshop
Kafka WorkshopKafka Workshop
Kafka Workshop
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Ch09
Ch09Ch09
Ch09
 
Capm scenario identifying the critical path answers
Capm scenario identifying the critical path   answersCapm scenario identifying the critical path   answers
Capm scenario identifying the critical path answers
 
Bind How To
Bind How ToBind How To
Bind How To
 
Meeting 12. pop, imap.ppt
Meeting 12. pop, imap.pptMeeting 12. pop, imap.ppt
Meeting 12. pop, imap.ppt
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
 
GEO mapbox geo_api_develop2 Intro
 GEO mapbox geo_api_develop2 Intro GEO mapbox geo_api_develop2 Intro
GEO mapbox geo_api_develop2 Intro
 
CentOS Server CLI Configuration (Nmcli & Hosts)
CentOS Server CLI Configuration (Nmcli & Hosts)CentOS Server CLI Configuration (Nmcli & Hosts)
CentOS Server CLI Configuration (Nmcli & Hosts)
 

Similar to Use TestRPC in Remix

Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
Johnny Pork
 
1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will devel1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will devel
AgripinaBeaulieuyw
 
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
hanneloremccaffery
 
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxProject Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
kacie8xcheco
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件
wensheng wei
 
Components of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdfComponents of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdf
alamodeindia1
 

Similar to Use TestRPC in Remix (20)

692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications
 
Implement ERC20 on TestRPC
Implement ERC20 on TestRPCImplement ERC20 on TestRPC
Implement ERC20 on TestRPC
 
QoS Classification on Cisco IOS Router
QoS Classification on Cisco IOS RouterQoS Classification on Cisco IOS Router
QoS Classification on Cisco IOS Router
 
1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will devel1)Building a MultiThreaded Web ServerIn this lab we will devel
1)Building a MultiThreaded Web ServerIn this lab we will devel
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
TCP Sockets Tutor maXbox starter26
TCP Sockets Tutor maXbox starter26TCP Sockets Tutor maXbox starter26
TCP Sockets Tutor maXbox starter26
 
application layer protocol for iot.pptx
application layer protocol for iot.pptxapplication layer protocol for iot.pptx
application layer protocol for iot.pptx
 
Md13 networking
Md13 networkingMd13 networking
Md13 networking
 
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
 
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxProject Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
 
Networking in java, Advanced programming
Networking in java, Advanced programmingNetworking in java, Advanced programming
Networking in java, Advanced programming
 
CCNA 1 Chapter 10 v5.0 2014
CCNA 1 Chapter 10 v5.0 2014CCNA 1 Chapter 10 v5.0 2014
CCNA 1 Chapter 10 v5.0 2014
 
Intake 37 12
Intake 37 12Intake 37 12
Intake 37 12
 
Ccna 4 chapter 2 2011 v4
Ccna 4 chapter 2 2011 v4Ccna 4 chapter 2 2011 v4
Ccna 4 chapter 2 2011 v4
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件
 
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
 
Components of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdfComponents of computer systems often have dependencies--other co.pdf
Components of computer systems often have dependencies--other co.pdf
 

More from KC Tam

More from KC Tam (9)

Access Tokens from Metamask
Access Tokens from MetamaskAccess Tokens from Metamask
Access Tokens from Metamask
 
ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token Contract
 
Ethereum: Native Currency and Token
Ethereum: Native Currency and TokenEthereum: Native Currency and Token
Ethereum: Native Currency and Token
 
Use Geth to Deploy Contract
Use Geth to Deploy ContractUse Geth to Deploy Contract
Use Geth to Deploy Contract
 
Use Geth to Access a Deployed Contract
Use Geth to Access a Deployed ContractUse Geth to Access a Deployed Contract
Use Geth to Access a Deployed Contract
 
Contract Practice with Remix
Contract Practice with RemixContract Practice with Remix
Contract Practice with Remix
 
Solidity Contract: the code, compilation, deployment and accessing
Solidity Contract: the code, compilation, deployment and accessing Solidity Contract: the code, compilation, deployment and accessing
Solidity Contract: the code, compilation, deployment and accessing
 
Access a Simple DApp
Access a Simple DAppAccess a Simple DApp
Access a Simple DApp
 
Essential Ethereum
Essential EthereumEssential Ethereum
Essential Ethereum
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Use TestRPC in Remix

  • 1. 5. TestRPC and Remix KC Tam Reach KC on LinkedIn: https://www.linkedin.com/in/ktam1/
  • 2. Objective TestRPC is a more common in-memory Ethereum Environment for Solidity Contract Development. Here we will explore how to start TestRPC and to access TestRPC from Remix.
  • 3. Remix supports three Ethereum Environments when running a contract.
  • 4. Remix Ethereum Environment JavaScript VM Injected Web3 Web3 Provider Remix in-memory Ethereum Network, running inside Remix. Working with injected Web3 such as Mist and Metamask Interacting with localhost through RPC Mainnet Testnet(s) TestRPCPrivate Net If localhost provides RPC interface, Remix can connect to these Ethereum networks. Here we focus on TestRPC. The most common RPC interface is on http://localhost:8545, but is configurable.
  • 5. Local host TestRPC Remix http://localhost:8545 A common in-memory Ethereum environment for contract and DApp development Comes with 10 accounts with 100 ethers predeposited Mnemonic hierarchical deterministic wallet Note: It is renamed to ganache-cli recently by Truffle, the maintainer, but we keep using TestRPC in this deck. TestRPC
  • 6. After running TestRPC, 10 accounts are created, with both address and private key. $ testrpc New set of 10 accounts are created when running TestRPC next time. To keep the same set of address, use the mnemonic $ testrpc -m "<mnemonic>" TestRPC is listening on localhost:8545
  • 7. With TestRPC running, select Web3 Provider in Remix.
  • 8. Remix requests the Web3 Provider Endpoint, which is the rpc interface on the Ethereum Network. As we notice, TestRPC is already "Listening on localhost: 8545". Click OK to continue.
  • 9. Environment is set to Web3 Provider, and from Accounts we see the 10 accounts from TestRPC.
  • 10. Now we can use Remix as before: deploying contract and executing functions. The difference is that now we are acting on TestRPC Ethereum Network. Note the output on TestRPC terminal and we start understanding what happens when contract is deployed and functions are executed.
  • 11. When create a contract, we see a transaction is issued to TestRPC. The Contract created matches the contract address shown in Remix 0xbd5…eb764.
  • 12. When set function is executed, it is another transaction Remix issues on TestRPC.
  • 13. Summary TestRPC is a more commonly used Ethereum environment for contract and DApp development. While there is no difference on Remix side, with TestRPC we can see what happens when contract is deployed and function is executed.