Skip to content

Latest commit

 

History

History
74 lines (69 loc) · 3.37 KB

2018-Nov.md

File metadata and controls

74 lines (69 loc) · 3.37 KB

November 2018

  1. Creating Ethereum testnet

    • Info: https://medium.com/mercuryprotocol/how-to-create-your-own-private-ethereum-blockchain-dad6af82fc9f
    • Get geth from : https://geth.ethereum.org/downloads/
    • Create a genesis file: myGenesis.json with content:
      {
        "config": {
           "chainId": 1994,
           "homesteadBlock": 0,
           "eip155Block": 0,
           "eip158Block": 0,
           "byzantiumBlock": 0
        },
        "difficulty": "400",
        "gasLimit": "2000000",
        "alloc": {
           "7b684d27167d208c66584ece7f09d8bc8f86ffff": { 
               "balance": "100000000000000000000000" 
           },
           "ae13d41d66af28380c7af6d825ab557eb271ffff": { 
               "balance": "120000000000000000000000" 
           }
         }
      }
      
    • Initiate node: geth --datadir ./myDataDir init ./myGenesis.json
    • Delete generated DAG before starting node: rm ~\AppData\Ethash\full*
    • Start peer node: geth –datadir ./myDataDir --networkid 1114 console 2>> myEth.log
    • Read log: gc .\myEth.log | Select-String -Pattern "INFO" | Select-Object -Last 30
  2. Golang templates (tags: golang html server template)

    • Templates are you know what they are pfff.
    • Parse whenever you parse new template text the previous one is overwritten (genius)
    • {{ define }} and {{ template }} don’t work with Parse
    • ParseFiles needs exact file location so forget that too.
    • Important links: https://gowebexamples.com/templates/
  3. Http post request form-data vs json data body

    Form-data Json-data
    Content-Type: application/x-www-form-urlencoded Content-Type: application/json
    Example data: say=Hi&to=Mom Example data: {“say”: “Hi”, “to”: “Mom”}
    Form-data is sent by browser in a post request “json-data” is generally used in REST protocol
  4. Go channels:

  5. Golang testing:

    • A test file ends with {something}_test.go
    • Execute with: go test
    • Call t.Parallel() to run that test in parallel to its siblings i.e. its children will still run sequentially
    • t.Run completes only when all its inner tests complete.
  6. Lambda Calculus:

  7. Adding formatted code text in windows (tag code formatted text notepad notepad++ plugin)

    • Do this by adding NppExport Plugin to notepad++
    • To add a plugin to notepad++:
    • Download the plugin dll file
    • Create a folder inside the plugin folder (C:\Program Files\Notepad++\plugins)
  8. https://www.hanselman.com/blog/CompilingCToWASMWithMonoAndBlazorThenDebuggingNETSourceWithRemoteDebuggingInChromeDevTools.aspx

    • Tags: wasm c# csharp c sharp web development razor pages
  9. Golang http server: