This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -X POST \ | |
| http://localhost:5000/transactions/new \ | |
| -H 'content-type: application/json' \ | |
| -d '{ | |
| "sender": "d4ee26eee15148ee92c6cd394edd974e", | |
| "recipient": "4as226eee1514743e92c6cd394edd974f", | |
| "amount": 5 | |
| }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -X GET \ | |
| http://localhost:5000/chain \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| public typealias CompletionHandler = () -> Void | |
| protocol CountDown: NSObjectProtocol { | |
| // 1 | |
| var timeElapsed: TimeInterval {get set} | |
| var timeLimit: TimeInterval {get set} | |
| // 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // CountDownTimer.swift | |
| // | |
| // Created by Harsh Vishwakarma. | |
| // | |
| import Foundation | |
| import UIKit | |
| final class CountDownTimer: NSObject, CountDown { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public typealias CompletionHandler = () -> Void | |
| class LiftOffViewController : UIViewController { | |
| var countDownTimer: CountDown? | |
| @IBOutlet weak var labelTimeLeft: UILabel! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIViewController+ShorthandAlerts.swift | |
| // | |
| // Created by Ayden Panhuyzen on 2017-07-31. | |
| // Copyright © 2017-2018 Ayden Panhuyzen. All rights reserved. | |
| // https://gist.github.com/aydenp | |
| // | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // PercentLayoutConstraint.swift | |
| import Foundation | |
| import UIKit | |
| @IBDesignable | |
| final class PercentLayoutConstraint: NSLayoutConstraint { | |
| @IBInspectable var marginPercent: CGFloat = 0 | |
| var screenSize: (width: CGFloat, height: CGFloat) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ConnectorView.swift | |
| // Helper | |
| // | |
| // Created by Harsh 20/08/20. | |
| // Copyright © 2020 Harsh. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [package] | |
| name = "blockchain" | |
| version = "0.1.0" | |
| authors = ["Harsh Vishwakarma"] | |
| edition = "2018" | |
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
| [dependencies] | |
| chrono = { version = " 0.4", features = ["serde"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub struct Block { | |
| index: u64, | |
| timestamp: DateTime<Utc>, | |
| transactions: Vec<Transaction>, | |
| proof: u64, | |
| previous_hash: String, | |
| } |