function MegaContract() public payable {
To do anything that requires gas, either unlock the account beforehand with the password:
var address = "..."; var password = "..."; var web3 = new Web3(); var unlockAccountResult = await web3.Personal.UnlockAccount.SendRequestAsync(address, password, 120); Assert.IsTrue(unlockAccountResult);
Or use the private key to create the Web3 object:
var privateKey = "..."; var web3 = new Web3(new Account(privateKey));
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
choco install git -params "/GetAndUnixToolsOnPath"
git config --system http.sslverify false
npm install -g node-gyp
npm install --global --production windows-build-tools
npm install -g ethereumjs-testrpc
npm install -g truffle
truffle init | Set up project. |
testrpc | Start RPC. |
truffle.cmd comp | Compile everything. |
truffle.cmd migrate | Deploy everything. |
truffle.cmd console | Console mode (to interact with contract). |
[Truffle Console] var hw | Create a variable to reference our contract. |
[Truffle Console] HelloWorld.deployed().then(function(deployed){hw=deployed;}); | Get the reference (note that it is async). |
[Truffle Console] hw.SayHello.call() | Call a read-only method on the contract. |
[Truffle Console] hw.sendCoin('0x8...', 100) | Call a modifying method on the contract. |
[Truffle Console] .exit | Exit console mode. |
Implementation | Language | Pruning | Notes |
---|---|---|---|
Geth | Go | Yes | |
Parity | Rust | Yes | |
EthereumJ | Java | Yes | |
Eth | C++ | No | Reference implementation is meant for developers only. |
PyEthApp | Python | No |
ABI | Application Binary Interface. Is basically how you call functions in a contract and get data back. Like a WSDL or .h file in C. |
Use the Solidity extension.
Start with Nethereum.Web3.
Video is here.
Geth's encrypted accounts key store files can be found in %APPDATA%/Ethereum
.
C:\Users\TallGuy-DevVm\Dev\Geth\startgeth.bat
(Get-Process geth).PriorityClass = "BelowNormal"